diff --git a/spec/features/admin/budget_investments_spec.rb b/spec/features/admin/budget_investments_spec.rb index d16539541..e758cfaab 100644 --- a/spec/features/admin/budget_investments_spec.rb +++ b/spec/features/admin/budget_investments_spec.rb @@ -700,10 +700,8 @@ describe "Admin budget investments" do end scenario "Combination of select with text search", :js do - create(:budget_investment, :finished, budget: budget, title: "Educate the children", - feasibility: "feasible") - create(:budget_investment, :finished, budget: budget, title: "More schools", - feasibility: "feasible") + create(:budget_investment, :feasible, :finished, budget: budget, title: "Educate the children") + create(:budget_investment, :feasible, :finished, budget: budget, title: "More schools") create(:budget_investment, budget: budget, title: "More hospitals") visit admin_budget_budget_investments_path(budget_id: budget.id) @@ -740,11 +738,9 @@ describe "Admin budget investments" do user = create(:user, username: "Admin 1") administrator = create(:administrator, user: user) - create(:budget_investment, :finished, budget: budget, title: "Educate the children", - feasibility: "feasible", + create(:budget_investment, :feasible, :finished, budget: budget, title: "Educate the children", administrator: administrator) - create(:budget_investment, :finished, budget: budget, title: "More schools", - feasibility: "feasible", + create(:budget_investment, :feasible, :finished, budget: budget, title: "More schools", administrator: administrator) create(:budget_investment, budget: budget, title: "More hospitals", administrator: administrator) @@ -984,10 +980,10 @@ describe "Admin budget investments" do user = create(:user, username: "Rachel", email: "rachel@valuators.org") valuator = create(:valuator, user: user) budget_investment = create(:budget_investment, + :unfeasible, + unfeasibility_explanation: "It is impossible", price: 1234, price_first_year: 1000, - feasibility: "unfeasible", - unfeasibility_explanation: "It is impossible", administrator: administrator) budget_investment.valuators << valuator @@ -1015,10 +1011,10 @@ describe "Admin budget investments" do scenario "Show image and documents on investment details" do budget_investment = create(:budget_investment, + :unfeasible, + unfeasibility_explanation: "It is impossible", price: 1234, price_first_year: 1000, - feasibility: "unfeasible", - unfeasibility_explanation: "It is impossible", administrator: administrator) create(:image, imageable: budget_investment) document = create(:document, documentable: budget_investment) @@ -1045,10 +1041,9 @@ describe "Admin budget investments" do scenario "Not show related content or hide links on preview" do budget_investment = create(:budget_investment, + :unfeasible, price: 1234, price_first_year: 1000, - feasibility: "unfeasible", - unfeasibility_explanation: "It is impossible", administrator: administrator) visit admin_budget_budget_investments_path(budget_investment.budget) diff --git a/spec/features/admin/change_log_spec.rb b/spec/features/admin/change_log_spec.rb index 2584971f4..0f393e971 100644 --- a/spec/features/admin/change_log_spec.rb +++ b/spec/features/admin/change_log_spec.rb @@ -15,10 +15,10 @@ describe "Admin change log" do scenario "No changes" do budget_investment = create(:budget_investment, + :unfeasible, + unfeasibility_explanation: "It is impossible", price: 1234, price_first_year: 1000, - feasibility: "unfeasible", - unfeasibility_explanation: "It is impossible", administrator: administrator) visit admin_budget_budget_investments_path(budget_investment.budget) @@ -34,10 +34,10 @@ describe "Admin change log" do scenario "Changes" do budget_investment = create(:budget_investment, + :unfeasible, + unfeasibility_explanation: "It is impossible", price: 1234, price_first_year: 1000, - feasibility: "unfeasible", - unfeasibility_explanation: "It is impossible", administrator: administrator) visit admin_budget_budget_investments_path(budget_investment.budget) diff --git a/spec/features/budgets/ballots_spec.rb b/spec/features/budgets/ballots_spec.rb index 11e5b3eaa..273c82444 100644 --- a/spec/features/budgets/ballots_spec.rb +++ b/spec/features/budgets/ballots_spec.rb @@ -577,7 +577,7 @@ describe "Ballots" do end scenario "Investments with feasibility undecided are not shown" do - investment = create(:budget_investment, feasibility: "undecided", heading: new_york) + investment = create(:budget_investment, :undecided, heading: new_york) login_as(user) visit budget_path(budget) diff --git a/spec/features/valuation/budget_investments_spec.rb b/spec/features/valuation/budget_investments_spec.rb index ed64436d5..2a4249637 100644 --- a/spec/features/valuation/budget_investments_spec.rb +++ b/spec/features/valuation/budget_investments_spec.rb @@ -241,7 +241,7 @@ describe "Valuation budget investments" do create(:valuator, user: create(:user, username: "Rick", email: "rick@valuators.org")) end let(:investment) do - create(:budget_investment, budget: budget, price: 1234, feasibility: "unfeasible", + create(:budget_investment, :unfeasible, budget: budget, price: 1234, unfeasibility_explanation: "It is impossible", administrator: administrator,) end diff --git a/spec/models/budget/investment_spec.rb b/spec/models/budget/investment_spec.rb index 6aecacfd2..283bcf023 100644 --- a/spec/models/budget/investment_spec.rb +++ b/spec/models/budget/investment_spec.rb @@ -262,9 +262,7 @@ describe Budget::Investment do describe "#should_show_unfeasibility_explanation?" do let(:budget) { create(:budget) } let(:investment) do - create(:budget_investment, :finished, budget: budget, - unfeasibility_explanation: "because of reasons", - feasibility: "unfeasible") + create(:budget_investment, :unfeasible, :finished, budget: budget) end it "returns true for unfeasible investments with unfeasibility explanation and valuation finished" do