From a92ef57bf84c2398e7ba069130ea8a51948633b7 Mon Sep 17 00:00:00 2001 From: Bertocq Date: Tue, 6 Mar 2018 11:22:35 +0100 Subject: [PATCH] Make valuator spec 100 LineLength compliant Readability of the code is important --- .../valuation/budget_investments_spec.rb | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/spec/features/valuation/budget_investments_spec.rb b/spec/features/valuation/budget_investments_spec.rb index 99836b9d4..16e3aa09c 100644 --- a/spec/features/valuation/budget_investments_spec.rb +++ b/spec/features/valuation/budget_investments_spec.rb @@ -13,7 +13,9 @@ feature 'Valuation budget investments' do scenario 'Disabled with a feature flag' do Setting['feature.budgets'] = nil - expect{ visit valuation_budget_budget_investments_path(create(:budget)) }.to raise_exception(FeatureFlags::FeatureDisabled) + expect{ + visit valuation_budget_budget_investments_path(create(:budget)) + }.to raise_exception(FeatureFlags::FeatureDisabled) Setting['feature.budgets'] = true end @@ -68,8 +70,10 @@ feature 'Valuation budget investments' do group = create(:budget_group, budget: budget) heading1 = create(:budget_heading, name: "District 9", group: group) heading2 = create(:budget_heading, name: "Down to the river", group: group) - investment1 = create(:budget_investment, title: "Realocate visitors", heading: heading1, group: group, budget: budget) - investment2 = create(:budget_investment, title: "Destroy the city", heading: heading2, group: group, budget: budget) + investment1 = create(:budget_investment, title: "Realocate visitors", heading: heading1, + group: group, budget: budget) + investment2 = create(:budget_investment, title: "Destroy the city", heading: heading2, + group: group, budget: budget) investment1.valuators << valuator investment2.valuators << valuator @@ -119,7 +123,8 @@ feature 'Valuation budget investments' do scenario "Index filtering by valuation status" do valuating = create(:budget_investment, budget: budget, title: "Ongoing valuation") - valuated = create(:budget_investment, budget: budget, title: "Old idea", valuation_finished: true) + valuated = create(:budget_investment, budget: budget, title: "Old idea", + valuation_finished: true) valuating.valuators << valuator valuated.valuators << valuator @@ -140,7 +145,7 @@ feature 'Valuation budget investments' do end feature 'Show' do - let(:administrator) do + let(:administrator) do create(:administrator, user: create(:user, username: 'Ana', email: 'ana@admins.org')) end let(:second_valuator) do @@ -201,7 +206,9 @@ feature 'Valuation budget investments' do logout login_as create(:valuator).user - expect { visit valuation_budget_budget_investment_path(budget, investment) }.to raise_error "Not Found" + expect{ + visit valuation_budget_budget_investment_path(budget, investment) + }.to raise_error "Not Found" end end @@ -275,7 +282,8 @@ feature 'Valuation budget investments' do end scenario 'Feasibility selection makes proper fields visible', :js do - feasible_fields = ['Price (€)', 'Cost during the first year (€)', 'Price explanation', 'Time scope'] + feasible_fields = ['Price (€)', 'Cost during the first year (€)', 'Price explanation', + 'Time scope'] unfeasible_fields = ['Feasibility explanation'] any_feasibility_fields = ['Valuation finished'] undecided_fields = feasible_fields + unfeasible_fields + any_feasibility_fields