diff --git a/spec/system/admin/budgets_wizard/phases_spec.rb b/spec/system/admin/budgets_wizard/phases_spec.rb index 57c9e5eea..f8c408467 100644 --- a/spec/system/admin/budgets_wizard/phases_spec.rb +++ b/spec/system/admin/budgets_wizard/phases_spec.rb @@ -64,21 +64,7 @@ describe "Budgets wizard, phases step", :admin do end describe "Edit" do - scenario "update phase" do - visit admin_budgets_wizard_budget_budget_phases_path(budget) - - expect(page).to have_css ".creation-timeline" - - within("tr", text: "Selecting projects") { click_link "Edit" } - fill_in "Name", with: "Choosing projects" - click_button "Save changes" - - expect(page).to have_content "Changes saved" - expect(page).to have_css ".creation-timeline" - within_table("Phases") { expect(page).to have_content "Choosing projects" } - end - - scenario "submit the form with errors and then without errors" do + scenario "update phase with errors and then without errors" do phase = budget.phases.accepting visit edit_admin_budgets_wizard_budget_budget_phase_path(budget, phase) @@ -88,17 +74,19 @@ describe "Budgets wizard, phases step", :admin do expect(page).to have_css "#error_explanation" expect(page).to have_css ".creation-timeline" - fill_in "Name", with: "Welcoming projects" + fill_in "Name", with: "Choosing projects" click_button "Save changes" expect(page).to have_content "Changes saved" expect(page).to have_css ".creation-timeline" - within_table("Phases") { expect(page).to have_content "Welcoming projects" } + within_table("Phases") { expect(page).to have_content "Choosing projects" } end scenario "update phase in single heading budget" do visit admin_budgets_wizard_budget_budget_phases_path(budget, mode: "single") + expect(page).to have_css ".creation-timeline" + within("tr", text: "Selecting projects") { click_link "Edit" } fill_in "Name", with: "Choosing projects" click_button "Save changes"