Use visible texts in tests

Content like lowercase letters with `text-transform: uppercase` or
spaces after elements with `display: block` or "You're on page:" are not
seen that way by users with a browser supporting CSS.

So we're testing what most users actually experience.
This commit is contained in:
Javi Martín
2021-03-30 20:00:57 +02:00
parent 23945c2a7c
commit 9cfcbf2f3b
15 changed files with 122 additions and 121 deletions

View File

@@ -379,7 +379,7 @@ describe "Proposal's dashboard" do
anchor: "tab-notifications"))
end
scenario "Dashboard has a related content section" do
scenario "Dashboard has a related content section", :js do
related_debate = create(:debate)
related_proposal = create(:proposal)
@@ -399,9 +399,9 @@ describe "Proposal's dashboard" do
within(".dashboard-related-content") do
expect(page).to have_content("Related content (2)")
expect(page).to have_selector(".related-content-title", text: "Proposal")
expect(page).to have_selector(".related-content-title", text: "PROPOSAL")
expect(page).to have_link related_proposal.title
expect(page).to have_selector(".related-content-title", text: "Debate")
expect(page).to have_selector(".related-content-title", text: "DEBATE")
expect(page).to have_link related_debate.title
end
end