Fix Style/NestedParenthesizedCalls rubocop issues

This commit is contained in:
Bertocq
2017-09-25 22:47:59 +02:00
parent 5129fc83a8
commit ca35c8b85c
6 changed files with 23 additions and 34 deletions

View File

@@ -572,17 +572,6 @@ Style/MutableConstant:
- 'lib/tag_sanitizer.rb' - 'lib/tag_sanitizer.rb'
- 'lib/wysiwyg_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 # Offense count: 54
# Cop supports --auto-correct. # Cop supports --auto-correct.
# Configuration parameters: Strict. # Configuration parameters: Strict.

View File

@@ -66,7 +66,7 @@ feature 'Debates' do
first(:link, debate.title).click first(:link, debate.title).click
link_text = find_link('Go back')[:href] 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 end
context "Show" do context "Show" do

View File

@@ -335,9 +335,9 @@ feature 'Emails' do
reset_mailer reset_mailer
budget.email_selected budget.email_selected
expect(find_email investment1.author.email).to be expect(find_email(investment1.author.email)).to be
expect(find_email investment2.author.email).to be expect(find_email(investment2.author.email)).to be
expect(find_email investment3.author.email).to_not be expect(find_email(investment3.author.email)).to_not be
email = open_last_email email = open_last_email
investment = investment2 investment = investment2
@@ -358,9 +358,9 @@ feature 'Emails' do
reset_mailer reset_mailer
budget.email_unselected budget.email_unselected
expect(find_email investment1.author.email).to be expect(find_email(investment1.author.email)).to be
expect(find_email investment2.author.email).to be expect(find_email(investment2.author.email)).to be
expect(find_email investment3.author.email).to_not be expect(find_email(investment3.author.email)).to_not be
email = open_last_email email = open_last_email
investment = investment2 investment = investment2

View File

@@ -271,20 +271,20 @@ feature 'Valuation budget investments' do
visit valuation_budget_budget_investment_path(@budget, @investment) visit valuation_budget_budget_investment_path(@budget, @investment)
click_link 'Edit dossier' 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' choose 'budget_investment_feasibility_feasible'
click_button 'Save changes' click_button 'Save changes'
visit edit_valuation_budget_budget_investment_path(@budget, @investment) visit edit_valuation_budget_budget_investment_path(@budget, @investment)
expect(find "#budget_investment_feasibility_undecided").to_not be_checked expect(find("#budget_investment_feasibility_undecided")).to_not be_checked
expect(find "#budget_investment_feasibility_feasible").to be_checked expect(find("#budget_investment_feasibility_feasible")).to be_checked
choose 'budget_investment_feasibility_undecided' choose 'budget_investment_feasibility_undecided'
click_button 'Save changes' click_button 'Save changes'
visit edit_valuation_budget_budget_investment_path(@budget, @investment) 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 end
scenario 'Feasibility selection makes proper fields visible', :js do 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) 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| undecided_fields.each do |field|
expect(page).to have_content(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) 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| feasible_fields.each do |field|
expect(page).to_not have_content(field) expect(page).to_not have_content(field)
end end

View File

@@ -21,10 +21,10 @@ RSpec.describe SettingsHelper, type: :helper do
Setting["feature.f2"] = "" Setting["feature.f2"] = ""
Setting["feature.f3"] = nil Setting["feature.f3"] = nil
expect(feature? "f1").to eq("active") expect(feature?("f1")).to eq("active")
expect(feature? "f2").to eq(nil) expect(feature?("f2")).to eq(nil)
expect(feature? "f3").to eq(nil) expect(feature?("f3")).to eq(nil)
expect(feature? "f4").to eq(nil) expect(feature?("f4")).to eq(nil)
end end
end end

View File

@@ -4,20 +4,20 @@ describe VerificationHelper do
describe "#mask_phone" do describe "#mask_phone" do
it "should mask a phone" do it "should mask a phone" do
expect(mask_phone "612345678").to eq("******678") expect(mask_phone("612345678")).to eq("******678")
end end
end end
describe "#mask_email" do describe "#mask_email" do
it "should mask a long email address" do it "should mask a long email address" do
expect(mask_email "isabel@example.com").to eq("isa***@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") expect(mask_email("antonio.perez@example.com")).to eq("ant**********@example.com")
end end
it "should mask a short email address" do it "should mask a short email address" do
expect(mask_email "an@example.com").to eq("an@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("ana@example.com")).to eq("ana@example.com")
expect(mask_email "aina@example.com").to eq("ain*@example.com") expect(mask_email("aina@example.com")).to eq("ain*@example.com")
end end
end end