diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 2cc988a87..91d320dc5 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -572,17 +572,6 @@ Style/MutableConstant: - 'lib/tag_sanitizer.rb' - 'lib/wysiwyg_sanitizer.rb' -# Offense count: 29 -# Cop supports --auto-correct. -Style/NestedParenthesizedCalls: - Exclude: - - 'spec/features/debates_spec.rb' - - 'spec/features/emails_spec.rb' - - 'spec/features/valuation/budget_investments_spec.rb' - - 'spec/features/valuation/spending_proposals_spec.rb' - - 'spec/helpers/settings_helper_spec.rb' - - 'spec/helpers/verification_helper_spec.rb' - # Offense count: 54 # Cop supports --auto-correct. # Configuration parameters: Strict. diff --git a/spec/features/debates_spec.rb b/spec/features/debates_spec.rb index a50363489..61210df6e 100644 --- a/spec/features/debates_spec.rb +++ b/spec/features/debates_spec.rb @@ -66,7 +66,7 @@ feature 'Debates' do first(:link, debate.title).click link_text = find_link('Go back')[:href] - expect(link_text).to include(debates_path order: :hot_score, page: 1) + expect(link_text).to include(debates_path(order: :hot_score, page: 1)) end context "Show" do diff --git a/spec/features/emails_spec.rb b/spec/features/emails_spec.rb index af7674101..21fdf8a64 100644 --- a/spec/features/emails_spec.rb +++ b/spec/features/emails_spec.rb @@ -335,9 +335,9 @@ feature 'Emails' do reset_mailer budget.email_selected - expect(find_email investment1.author.email).to be - expect(find_email investment2.author.email).to be - expect(find_email investment3.author.email).to_not be + expect(find_email(investment1.author.email)).to be + expect(find_email(investment2.author.email)).to be + expect(find_email(investment3.author.email)).to_not be email = open_last_email investment = investment2 @@ -358,9 +358,9 @@ feature 'Emails' do reset_mailer budget.email_unselected - expect(find_email investment1.author.email).to be - expect(find_email investment2.author.email).to be - expect(find_email investment3.author.email).to_not be + expect(find_email(investment1.author.email)).to be + expect(find_email(investment2.author.email)).to be + expect(find_email(investment3.author.email)).to_not be email = open_last_email investment = investment2 diff --git a/spec/features/valuation/budget_investments_spec.rb b/spec/features/valuation/budget_investments_spec.rb index 3f91d8925..a627d9422 100644 --- a/spec/features/valuation/budget_investments_spec.rb +++ b/spec/features/valuation/budget_investments_spec.rb @@ -271,20 +271,20 @@ feature 'Valuation budget investments' do visit valuation_budget_budget_investment_path(@budget, @investment) click_link 'Edit dossier' - expect(find "#budget_investment_feasibility_undecided").to be_checked + expect(find("#budget_investment_feasibility_undecided")).to be_checked choose 'budget_investment_feasibility_feasible' click_button 'Save changes' visit edit_valuation_budget_budget_investment_path(@budget, @investment) - expect(find "#budget_investment_feasibility_undecided").to_not be_checked - expect(find "#budget_investment_feasibility_feasible").to be_checked + expect(find("#budget_investment_feasibility_undecided")).to_not be_checked + expect(find("#budget_investment_feasibility_feasible")).to be_checked choose 'budget_investment_feasibility_undecided' click_button 'Save changes' visit edit_valuation_budget_budget_investment_path(@budget, @investment) - expect(find "#budget_investment_feasibility_undecided").to be_checked + expect(find("#budget_investment_feasibility_undecided")).to be_checked end scenario 'Feasibility selection makes proper fields visible', :js do @@ -295,7 +295,7 @@ feature 'Valuation budget investments' do visit edit_valuation_budget_budget_investment_path(@budget, @investment) - expect(find "#budget_investment_feasibility_undecided").to be_checked + expect(find("#budget_investment_feasibility_undecided")).to be_checked undecided_fields.each do |field| expect(page).to have_content(field) @@ -325,7 +325,7 @@ feature 'Valuation budget investments' do visit edit_valuation_budget_budget_investment_path(@budget, @investment) - expect(find "#budget_investment_feasibility_unfeasible").to be_checked + expect(find("#budget_investment_feasibility_unfeasible")).to be_checked feasible_fields.each do |field| expect(page).to_not have_content(field) end diff --git a/spec/helpers/settings_helper_spec.rb b/spec/helpers/settings_helper_spec.rb index 0aa9b8541..0db6fed10 100644 --- a/spec/helpers/settings_helper_spec.rb +++ b/spec/helpers/settings_helper_spec.rb @@ -21,10 +21,10 @@ RSpec.describe SettingsHelper, type: :helper do Setting["feature.f2"] = "" Setting["feature.f3"] = nil - expect(feature? "f1").to eq("active") - expect(feature? "f2").to eq(nil) - expect(feature? "f3").to eq(nil) - expect(feature? "f4").to eq(nil) + expect(feature?("f1")).to eq("active") + expect(feature?("f2")).to eq(nil) + expect(feature?("f3")).to eq(nil) + expect(feature?("f4")).to eq(nil) end end diff --git a/spec/helpers/verification_helper_spec.rb b/spec/helpers/verification_helper_spec.rb index 1673264f7..43df6509f 100644 --- a/spec/helpers/verification_helper_spec.rb +++ b/spec/helpers/verification_helper_spec.rb @@ -4,20 +4,20 @@ describe VerificationHelper do describe "#mask_phone" do it "should mask a phone" do - expect(mask_phone "612345678").to eq("******678") + expect(mask_phone("612345678")).to eq("******678") end end describe "#mask_email" do it "should mask a long email address" do - expect(mask_email "isabel@example.com").to eq("isa***@example.com") - expect(mask_email "antonio.perez@example.com").to eq("ant**********@example.com") + expect(mask_email("isabel@example.com")).to eq("isa***@example.com") + expect(mask_email("antonio.perez@example.com")).to eq("ant**********@example.com") end it "should mask a short email address" do - expect(mask_email "an@example.com").to eq("an@example.com") - expect(mask_email "ana@example.com").to eq("ana@example.com") - expect(mask_email "aina@example.com").to eq("ain*@example.com") + expect(mask_email("an@example.com")).to eq("an@example.com") + expect(mask_email("ana@example.com")).to eq("ana@example.com") + expect(mask_email("aina@example.com")).to eq("ain*@example.com") end end