Simplify testing array contents

We were testing for the size and the content of the elements when we
could test for the array itself.
This commit is contained in:
Javi Martín
2019-09-24 21:01:32 +02:00
parent 4301937e85
commit f27beb1e47
17 changed files with 59 additions and 140 deletions

View File

@@ -131,8 +131,7 @@ describe Comment do
create(:comment, administrator_id: create(:administrator).id)
create(:comment, moderator_id: create(:moderator).id)
expect(Comment.not_as_admin_or_moderator.size).to eq(1)
expect(Comment.not_as_admin_or_moderator.first).to eq(comment1)
expect(Comment.not_as_admin_or_moderator).to eq [comment1]
end
end