Add missing expectations after consecutive visits

This way we're 100% sure we won't have simultaneous requests since the
test will wait for one request to finish before continuing.

In the debates spec, we're also making sure the expectations between the
two consecutive visits are different.
This commit is contained in:
Javi Martín
2025-03-10 22:50:58 +01:00
parent 40d89ee47c
commit 8350b787f9
2 changed files with 9 additions and 2 deletions

View File

@@ -664,10 +664,11 @@ describe "Debates" do
user.erase
visit debates_path
expect(page).to have_content("User deleted")
expect(page).to have_content "User deleted"
visit debate_path(debate)
expect(page).to have_content("User deleted")
expect(page).to have_css "h1", exact_text: debate.title
expect(page).to have_content "User deleted"
end
context "Suggesting debates" do

View File

@@ -39,7 +39,13 @@ describe "Sessions" do
user = create(:user, :level_two)
visit debates_path
expect(page).to have_content "Help with debates"
visit "/"
expect(page).to have_content "Most active proposals"
click_link "Sign in"
fill_in "user_login", with: user.email
fill_in "user_password", with: user.password