Test data introduced from the user's point of view

Users don't care about database content; they care about what they see
on the screen.

Writing tests this way we also avoid potencial database inconsistencies
due to accessing the database after starting the browser.
This commit is contained in:
Javi Martín
2021-04-10 16:43:43 +02:00
parent 7b15cc290d
commit 405c6e6d14
9 changed files with 31 additions and 22 deletions

View File

@@ -186,7 +186,7 @@ describe "Admin collaborative legislation", :admin do
expect(page).to have_content "An example legislation process"
expect(page).not_to have_content "Summary of the process"
expect(page).to have_css("img[alt='#{Legislation::Process.last.title}']")
expect(page).to have_css("img[alt='An example legislation process']")
end
scenario "Default colors are present" do