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.
This commit is contained in:
Javi Martín
2021-09-07 14:53:20 +02:00
parent fa15ac0c3b
commit 6ddb22c1ea

View File

@@ -1264,19 +1264,17 @@ describe "Admin budget investments", :admin do
expect(find("#js-investment-report-alert")).to be_checked expect(find("#js-investment-report-alert")).to be_checked
end end
# The feature tested in this scenario works as expected but some underlying reason scenario "Shows alert with unfeasible status when 'Valuation finished' is checked" do
# we're not aware of makes it fail at random
xscenario "Shows alert with unfeasible status when 'Valuation finished' is checked" do
budget_investment = create(:budget_investment, :unfeasible) budget_investment = create(:budget_investment, :unfeasible)
visit admin_budget_budget_investment_path(budget_investment.budget, budget_investment) visit admin_budget_budget_investment_path(budget_investment.budget, budget_investment)
click_link "Edit dossier" click_link "Edit dossier"
expect(page).to have_content("Valuation finished") expect(page).to have_field "Valuation finished", checked: false
valuation = find_field("budget_investment[valuation_finished]")
accept_confirm { check("Valuation finished") } accept_confirm { check("Valuation finished") }
expect(valuation).to be_checked expect(page).to have_field "Valuation finished", checked: true
end end
scenario "Undoes check in 'Valuation finished' if user clicks 'cancel' on alert" do scenario "Undoes check in 'Valuation finished' if user clicks 'cancel' on alert" do