Use refresh instead of visiting the current page
This way it's more obvious what's going on. Note that, in this case, the expectations were **not** true before visiting the page, so we aren't fixing a flaky test.
This commit is contained in:
@@ -72,7 +72,7 @@ describe "Admin budget investments", :admin do
|
||||
end
|
||||
|
||||
budget_investment3.update!(administrator_id: admin.id)
|
||||
visit admin_budget_budget_investments_path(budget_id: budget.id)
|
||||
refresh
|
||||
|
||||
within("#budget_investment_#{budget_investment3.id}") do
|
||||
expect(page).to have_content("Gema")
|
||||
@@ -1814,7 +1814,7 @@ describe "Admin budget investments", :admin do
|
||||
expect(cookie_value).to eq("id,supports,admin,geozone,feasibility,valuation_finished," \
|
||||
"visible_to_valuators,selected,incompatible,author")
|
||||
|
||||
visit admin_budget_budget_investments_path(budget)
|
||||
refresh
|
||||
|
||||
cookie_value = cookie_by_name("investments-columns")[:value]
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@ describe "Admin legislation questions", :admin do
|
||||
|
||||
expect(page).not_to have_css "#error_explanation"
|
||||
|
||||
visit edit_question_url
|
||||
refresh
|
||||
expect(page).to have_field(field_en[:id], with: "Changed")
|
||||
end
|
||||
|
||||
@@ -134,7 +134,7 @@ describe "Admin legislation questions", :admin do
|
||||
|
||||
expect(page).to have_content "Question updated successfully"
|
||||
|
||||
visit edit_question_url
|
||||
refresh
|
||||
|
||||
expect(page).not_to have_field fields_for(:en).first[:id], with: "Yes"
|
||||
expect(page).to have_field fields_for(:en).last[:id], with: "No"
|
||||
|
||||
@@ -68,7 +68,7 @@ describe "Admin booths", :admin do
|
||||
|
||||
expect(page).to have_content "Booth created successfully"
|
||||
|
||||
visit admin_booths_path
|
||||
refresh
|
||||
expect(page).to have_content "Upcoming booth"
|
||||
expect(page).to have_content "39th Street, number 2, ground floor"
|
||||
end
|
||||
|
||||
@@ -64,7 +64,7 @@ describe "Poll question options", :admin do
|
||||
expect(page).to have_content "Changes saved"
|
||||
expect(page).to have_content "New title"
|
||||
|
||||
visit admin_question_path(question)
|
||||
refresh
|
||||
|
||||
expect(page).not_to have_content "Answer title"
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ describe "Admin custom information texts", :admin do
|
||||
|
||||
expect(page).to have_content "Translation updated successfully"
|
||||
|
||||
visit admin_site_customization_information_texts_path
|
||||
refresh
|
||||
select "Français", from: "Current language"
|
||||
|
||||
expect(page).to have_content "Aide personalise sur les débats"
|
||||
|
||||
@@ -333,7 +333,7 @@ describe "System Emails" do
|
||||
|
||||
expect(page).not_to have_content("Proposal A Title")
|
||||
|
||||
visit admin_system_email_preview_pending_path("proposal_notification_digest")
|
||||
refresh
|
||||
|
||||
expect(page).to have_content("Proposal B")
|
||||
expect(page).not_to have_content("Proposal A Title")
|
||||
|
||||
@@ -26,7 +26,7 @@ describe "Admin tags", :admin do
|
||||
|
||||
within("table") { expect(page).to have_content "important issues" }
|
||||
|
||||
visit admin_tags_path
|
||||
refresh
|
||||
|
||||
expect(page).to have_content "important issues"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user