Clean up rating partials

This commit is contained in:
James Mason 2018-02-09 17:19:33 -08:00
parent 637f6ce765
commit 23d145d667
No known key found for this signature in database
GPG key ID: 1B3951886C449023
10 changed files with 103 additions and 92 deletions

View file

@ -18,4 +18,18 @@ describe EventsHelper, type: :helper do
end
end
end
describe "#rating_tooltip" do
let(:max_rating) { 5 }
let(:event) { create(:event) }
let(:average_rating) { "#{event.average_rating}/#{max_rating}" }
let(:vote_count) { pluralize(event.voters.length, 'vote') }
it "includes the average rating" do
expect(rating_tooltip(event, max_rating)).to match(average_rating)
end
it "includes the vote count" do
expect(rating_tooltip(event, max_rating)).to match(vote_count)
end
end
end