From 93fcf8893aeace094f79eedc9eaff3dea5eac0ae Mon Sep 17 00:00:00 2001 From: Sidharth Date: Mon, 4 Dec 2017 23:45:37 +0530 Subject: [PATCH] Fix Style/UnneededInterpolation Exclusions from .rubocop_todo.yml deleted. This cop checks for string interpolated expressions. It supports autocorrection. Fixes #1823 --- .rubocop_todo.yml | 7 ------- app/helpers/format_helper.rb | 2 +- spec/controllers/admin/conferences_controller_spec.rb | 4 ++-- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 4d2e6518..7664f6c3 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -722,10 +722,3 @@ Style/TrailingCommaInLiteral: - 'Guardfile' - 'db/migrate/20140701123203_add_events_per_week_to_conference.rb' - 'spec/models/conference_spec.rb' - -# Offense count: 3 -# Cop supports --auto-correct. -Style/UnneededInterpolation: - Exclude: - - 'app/helpers/format_helper.rb' - - 'spec/controllers/admin/conferences_controller_spec.rb' diff --git a/app/helpers/format_helper.rb b/app/helpers/format_helper.rb index 684e3754..a41c584e 100644 --- a/app/helpers/format_helper.rb +++ b/app/helpers/format_helper.rb @@ -122,7 +122,7 @@ module FormatHelper plural || singular.pluralize end - "#{word}" + word end # Returns black or white deppending on what of them contrast more with the diff --git a/spec/controllers/admin/conferences_controller_spec.rb b/spec/controllers/admin/conferences_controller_spec.rb index 009e40ba..ff9d676b 100644 --- a/spec/controllers/admin/conferences_controller_spec.rb +++ b/spec/controllers/admin/conferences_controller_spec.rb @@ -56,8 +56,8 @@ describe Admin::ConferencesController do conference.reload expect(flash[:error]) .to eq("Updating conference failed. Short title can't be blank.") - expect(conference.title).to eq("#{conference.title}") - expect(conference.short_title).to eq("#{conference.short_title}") + expect(conference.title).to eq(conference.title) + expect(conference.short_title).to eq(conference.short_title) end it 're-renders the #show template' do