Test slugs from the user's point of view

System tests are about user experience, so instead of checking the slug
has been updated in the database, we check whether the page can be
accessed using the slug.

Note the budget group test is a bit different because the name of the
group isn't present in the budget group page.
This commit is contained in:
Javi Martín
2021-04-10 16:09:27 +02:00
parent dbf7de5787
commit b55f2ab85c
4 changed files with 31 additions and 16 deletions

View File

@@ -75,7 +75,10 @@ describe "Admin polls", :admin do
expect(page).to have_content "Upcoming poll"
expect(page).to have_content I18n.l(start_date)
expect(page).to have_content I18n.l(end_date)
expect(Poll.last.slug).to eq "#{Poll.last.name.to_s.parameterize}"
visit poll_path(id: "upcoming-poll")
expect(page).to have_content "Upcoming poll"
end
scenario "Edit" do