Remove redundant expectations in polls tests

Furthermore, using `Poll.all` results in a database query, and doing so
after the process running the browser has started might result in
failures when running our test suite.
This commit is contained in:
Javi Martín
2022-06-02 18:59:13 +02:00
parent 9a8536b1fc
commit 0dded3fa22

View File

@@ -21,13 +21,6 @@ describe "Admin polls", :admin do
expect(page).to have_content "List of polls"
expect(page).to have_css ".poll", count: 3
polls = Poll.all
polls.each do |poll|
within("#poll_#{poll.id}") do
expect(page).to have_content poll.name
end
end
expect(poll_3.name).to appear_before(poll_1.name)
expect(poll_1.name).to appear_before(poll_2.name)
expect(page).not_to have_content "There are no polls"