Fix Style/NestedParenthesizedCalls rubocop issues
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user