From 6ddb22c1ea9bb918954f8c5fc813c2ba75758e2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Tue, 7 Sep 2021 14:53:20 +0200 Subject: [PATCH] Enable test checking alert to finish valuation It looks like it was disabled because it was failing sometimes for some reason. I haven't found the reason, though; we're changing the test a little bit to make it easier to read. Enabling it will let us find out whether it still fails. --- spec/system/admin/budget_investments_spec.rb | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/spec/system/admin/budget_investments_spec.rb b/spec/system/admin/budget_investments_spec.rb index fd0d8779e..6430f62da 100644 --- a/spec/system/admin/budget_investments_spec.rb +++ b/spec/system/admin/budget_investments_spec.rb @@ -1264,19 +1264,17 @@ describe "Admin budget investments", :admin do expect(find("#js-investment-report-alert")).to be_checked end - # The feature tested in this scenario works as expected but some underlying reason - # we're not aware of makes it fail at random - xscenario "Shows alert with unfeasible status when 'Valuation finished' is checked" do + scenario "Shows alert with unfeasible status when 'Valuation finished' is checked" do budget_investment = create(:budget_investment, :unfeasible) visit admin_budget_budget_investment_path(budget_investment.budget, budget_investment) click_link "Edit dossier" - expect(page).to have_content("Valuation finished") - valuation = find_field("budget_investment[valuation_finished]") + expect(page).to have_field "Valuation finished", checked: false + accept_confirm { check("Valuation finished") } - expect(valuation).to be_checked + expect(page).to have_field "Valuation finished", checked: true end scenario "Undoes check in 'Valuation finished' if user clicks 'cancel' on alert" do