Simplify testing arrays exact contents

Instead of testing the contents of each element, we can test the whole
array at once.
This commit is contained in:
Javi Martín
2019-09-26 17:30:38 +02:00
parent 24f14ea772
commit a04a289850
10 changed files with 44 additions and 114 deletions

View File

@@ -883,9 +883,7 @@ describe Budget::Investment do
most_voted = create(:budget_investment, cached_votes_up: 10)
some_votes = create(:budget_investment, cached_votes_up: 5)
expect(Budget::Investment.sort_by_confidence_score.first).to eq most_voted
expect(Budget::Investment.sort_by_confidence_score.second).to eq some_votes
expect(Budget::Investment.sort_by_confidence_score.third).to eq least_voted
expect(Budget::Investment.sort_by_confidence_score).to eq [most_voted, some_votes, least_voted]
end
it "orders by confidence_score and then by id" do