diff --git a/spec/system/account_spec.rb b/spec/system/account_spec.rb index 91e74ce7b..772373dfd 100644 --- a/spec/system/account_spec.rb +++ b/spec/system/account_spec.rb @@ -43,6 +43,7 @@ describe "Account" do refresh + expect(page).not_to have_content "Changes saved" expect(page).to have_css "input[value='Larry Bird']" expect(find("#account_email_on_comment")).to be_checked expect(find("#account_email_on_comment_reply")).to be_checked @@ -98,6 +99,7 @@ describe "Account" do refresh + expect(page).not_to have_content "Changes saved" expect(page).to have_css "input[value='Google']" expect(find("#account_email_on_comment")).to be_checked expect(find("#account_email_on_comment_reply")).to be_checked @@ -131,21 +133,25 @@ describe "Account" do expect(page).to have_content "Changes saved" refresh + + expect(page).not_to have_content "Changes saved" expect(find("#account_official_position_badge")).to be_checked end scenario "Users with official position of level 2 and above" do - official_user2 = create(:user, official_level: 2) - official_user3 = create(:user, official_level: 3) + official_user2 = create(:user, official_level: 2, username: "Official 2") + official_user3 = create(:user, official_level: 3, username: "Official 3") login_as(official_user2) visit account_path + expect(page).to have_field "Username", with: "Official 2" expect(page).not_to have_css "#account_official_position_badge" login_as(official_user3) refresh + expect(page).to have_field "Username", with: "Official 3" expect(page).not_to have_css "#account_official_position_badge" end end diff --git a/spec/system/admin/budget_investments_spec.rb b/spec/system/admin/budget_investments_spec.rb index eb820d0ef..d962447fe 100644 --- a/spec/system/admin/budget_investments_spec.rb +++ b/spec/system/admin/budget_investments_spec.rb @@ -1802,6 +1802,8 @@ describe "Admin budget investments", :admin do click_button "Columns" + expect(page).to have_css "button[aria-expanded=true]", exact_text: "Columns" + within("#js-columns-selector-wrapper") do uncheck "Title" uncheck "Price" @@ -1816,6 +1818,8 @@ describe "Admin budget investments", :admin do refresh + expect(page).to have_css "button[aria-expanded=false]", exact_text: "Columns" + cookie_value = cookie_by_name("investments-columns")[:value] expect(cookie_value).to eq("id,supports,admin,geozone,feasibility,valuation_finished," \ diff --git a/spec/system/admin/legislation/questions_spec.rb b/spec/system/admin/legislation/questions_spec.rb index 70e3934a9..0573c7dcd 100644 --- a/spec/system/admin/legislation/questions_spec.rb +++ b/spec/system/admin/legislation/questions_spec.rb @@ -110,9 +110,12 @@ describe "Admin legislation questions", :admin do find("#nested_question_options input").set("Changed") click_button "Save changes" + expect(page).to have_content "Question updated successfully" expect(page).not_to have_css "#error_explanation" refresh + + expect(page).not_to have_content "Question updated successfully" expect(page).to have_field(field_en[:id], with: "Changed") end @@ -136,6 +139,7 @@ describe "Admin legislation questions", :admin do refresh + expect(page).not_to have_content "Question updated successfully" 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" end diff --git a/spec/system/admin/poll/booths_spec.rb b/spec/system/admin/poll/booths_spec.rb index 5a12c77d9..562478caa 100644 --- a/spec/system/admin/poll/booths_spec.rb +++ b/spec/system/admin/poll/booths_spec.rb @@ -69,6 +69,8 @@ describe "Admin booths", :admin do expect(page).to have_content "Booth created successfully" refresh + + expect(page).not_to have_content "Booth created successfully" expect(page).to have_content "Upcoming booth" expect(page).to have_content "39th Street, number 2, ground floor" end diff --git a/spec/system/admin/poll/questions/options/options_spec.rb b/spec/system/admin/poll/questions/options/options_spec.rb index 50ce28e28..eef96328b 100644 --- a/spec/system/admin/poll/questions/options/options_spec.rb +++ b/spec/system/admin/poll/questions/options/options_spec.rb @@ -66,6 +66,7 @@ describe "Poll question options", :admin do refresh + expect(page).not_to have_content "Changes saved" expect(page).not_to have_content "Answer title" expect("Another title").to appear_before("New title") diff --git a/spec/system/admin/site_customization/information_texts_spec.rb b/spec/system/admin/site_customization/information_texts_spec.rb index 785a77d3e..ea8edd81c 100644 --- a/spec/system/admin/site_customization/information_texts_spec.rb +++ b/spec/system/admin/site_customization/information_texts_spec.rb @@ -75,6 +75,9 @@ describe "Admin custom information texts", :admin do expect(page).to have_content "Translation updated successfully" refresh + + expect(page).not_to have_content "Translation updated successfully" + select "Français", from: "Current language" expect(page).to have_content "Aide personalise sur les débats" diff --git a/spec/system/budgets/investments_spec.rb b/spec/system/budgets/investments_spec.rb index dd9d4df91..550d82c3e 100644 --- a/spec/system/budgets/investments_spec.rb +++ b/spec/system/budgets/investments_spec.rb @@ -1169,6 +1169,7 @@ describe "Budget Investments" do refresh + expect(page).not_to have_content "Investment project deleted successfully" expect(page).to have_content "User has no public activity" expect(page).not_to have_content investment1.title end