Fix all Layout/SpaceAfterComma issues and remove from rubocop_todo list
This commit is contained in:
@@ -557,21 +557,6 @@ Style/RescueModifier:
|
||||
- 'app/controllers/concerns/commentable_actions.rb'
|
||||
- 'app/controllers/verification/sms_controller.rb'
|
||||
|
||||
# Offense count: 14
|
||||
# Cop supports --auto-correct.
|
||||
Layout/SpaceAfterComma:
|
||||
Exclude:
|
||||
- 'app/models/ahoy/data_source.rb'
|
||||
- 'app/models/banner.rb'
|
||||
- 'app/models/concerns/search_cache.rb'
|
||||
- 'app/models/concerns/taggable.rb'
|
||||
- 'app/models/spending_proposal.rb'
|
||||
- 'app/models/user.rb'
|
||||
- 'spec/features/valuation/spending_proposals_spec.rb'
|
||||
- 'spec/lib/census_api_spec.rb'
|
||||
- 'spec/models/abilities/moderator_spec.rb'
|
||||
- 'spec/models/verification/management/email_spec.rb'
|
||||
|
||||
# Offense count: 20
|
||||
# Cop supports --auto-correct.
|
||||
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
||||
|
||||
@@ -4,7 +4,7 @@ class Admin::UsersController < Admin::BaseController
|
||||
def index
|
||||
if params[:search]
|
||||
s = params[:search]
|
||||
@users = User.where("username ILIKE ? OR email ILIKE ? OR document_number ILIKE ?", "%#{s}%","%#{s}%","%#{s}%").page(params[:page])
|
||||
@users = User.where("username ILIKE ? OR email ILIKE ? OR document_number ILIKE ?", "%#{s}%", "%#{s}%", "%#{s}%").page(params[:page])
|
||||
else
|
||||
@users = @users.page(params[:page])
|
||||
end
|
||||
|
||||
@@ -10,7 +10,7 @@ module Ahoy
|
||||
# chart
|
||||
def add(name, collection)
|
||||
collections.push data: collection, name: name
|
||||
collection.each{ |k,v| add_key k }
|
||||
collection.each{ |k, v| add_key k }
|
||||
end
|
||||
|
||||
def build
|
||||
|
||||
@@ -14,7 +14,7 @@ module SearchCache
|
||||
|
||||
def searchable_values_sql
|
||||
searchable_values
|
||||
.select{ |k,_| k.present? }
|
||||
.select{ |k, _| k.present? }
|
||||
.collect{ |value, weight| set_tsvector(value, weight) }
|
||||
.join(" || ")
|
||||
end
|
||||
|
||||
@@ -9,7 +9,7 @@ module Taggable
|
||||
def tag_list_with_limit(limit = nil)
|
||||
return tags if limit.blank?
|
||||
|
||||
tags.sort{|a,b| b.taggings_count <=> a.taggings_count}[0, limit]
|
||||
tags.sort{|a, b| b.taggings_count <=> a.taggings_count}[0, limit]
|
||||
end
|
||||
|
||||
def tags_count_out_of_limit(limit = nil)
|
||||
|
||||
@@ -44,7 +44,7 @@ class SpendingProposal < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def self.filter_params(params)
|
||||
params.select{|x,_| %w{geozone_id administrator_id tag_name valuator_id}.include? x.to_s }
|
||||
params.select{|x, _| %w{geozone_id administrator_id tag_name valuator_id}.include? x.to_s }
|
||||
end
|
||||
|
||||
def self.scoped_filter(params, current_filter)
|
||||
|
||||
@@ -74,7 +74,7 @@ class User < ActiveRecord::Base
|
||||
username: auth.info.name || auth.uid,
|
||||
email: oauth_email,
|
||||
oauth_email: oauth_email,
|
||||
password: Devise.friendly_token[0,20],
|
||||
password: Devise.friendly_token[0, 20],
|
||||
terms_of_service: '1',
|
||||
confirmed_at: oauth_email_confirmed ? DateTime.current : nil
|
||||
)
|
||||
|
||||
@@ -356,7 +356,7 @@ feature 'Admin polls' do
|
||||
question_2.valid_answers.each_with_index do |answer, i|
|
||||
within("#question_#{question_2.id}_#{i}_result") do
|
||||
expect(page).to have_content(answer)
|
||||
expect(page).to have_content([0,15][i])
|
||||
expect(page).to have_content([0, 15][i])
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ feature 'Users' do
|
||||
expect(user).to be_level_three_verified
|
||||
expect(user).to be_residence_verified
|
||||
expect(user).to_not be_confirmed
|
||||
expect(user.date_of_birth).to have_content (Date.new(1980,12,31))
|
||||
expect(user.date_of_birth).to have_content (Date.new(1980, 12, 31))
|
||||
|
||||
sent_token = /.*confirmation_token=(.*)".*/.match(ActionMailer::Base.deliveries.last.body.to_s)[1]
|
||||
visit user_confirmation_path(confirmation_token: sent_token)
|
||||
@@ -69,7 +69,7 @@ feature 'Users' do
|
||||
expect(user).to be_level_three_verified
|
||||
expect(user).to be_residence_verified
|
||||
expect(user).to be_confirmed
|
||||
expect(user.date_of_birth).to have_content (Date.new(1980,12,31))
|
||||
expect(user.date_of_birth).to have_content (Date.new(1980, 12, 31))
|
||||
end
|
||||
|
||||
scenario 'Delete a level 2 user account from document verification page', :js do
|
||||
|
||||
@@ -289,9 +289,9 @@ 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','Internal comments']
|
||||
any_feasibility_fields = ['Valuation finished', 'Internal comments']
|
||||
undecided_fields = feasible_fields + unfeasible_fields + any_feasibility_fields
|
||||
|
||||
visit edit_valuation_budget_budget_investment_path(@budget, @investment)
|
||||
|
||||
@@ -311,9 +311,9 @@ feature 'Valuation spending proposals' do
|
||||
end
|
||||
|
||||
scenario 'Feasibility selection makes proper fields visible', :js do
|
||||
feasible_true_fields = ['Price (€)','Cost during the first year (€)','Price explanation','Time scope']
|
||||
feasible_true_fields = ['Price (€)', 'Cost during the first year (€)', 'Price explanation', 'Time scope']
|
||||
feasible_false_fields = ['Feasibility explanation']
|
||||
feasible_any_fields = ['Valuation finished','Internal comments']
|
||||
feasible_any_fields = ['Valuation finished', 'Internal comments']
|
||||
feasible_nil_fields = feasible_true_fields + feasible_false_fields + feasible_any_fields
|
||||
|
||||
visit edit_valuation_spending_proposal_path(@spending_proposal)
|
||||
|
||||
@@ -39,7 +39,7 @@ describe CensusApi do
|
||||
response = api.call(1, "123456")
|
||||
|
||||
expect(response).to be_valid
|
||||
expect(response.date_of_birth).to eq(Date.new(1980,1,1))
|
||||
expect(response.date_of_birth).to eq(Date.new(1980, 1, 1))
|
||||
end
|
||||
|
||||
it "returns the last failed response" do
|
||||
|
||||
@@ -48,7 +48,7 @@ describe "Abilities::Moderator" do
|
||||
describe "hiding, reviewing and restoring" do
|
||||
let(:ignored_comment) { create(:comment, :with_ignored_flag) }
|
||||
let(:ignored_debate) { create(:debate, :with_ignored_flag) }
|
||||
let(:ignored_proposal) { create(:proposal,:with_ignored_flag) }
|
||||
let(:ignored_proposal) { create(:proposal, :with_ignored_flag) }
|
||||
|
||||
it { should be_able_to(:hide, comment) }
|
||||
it { should be_able_to(:hide_in_moderation_screen, comment) }
|
||||
|
||||
@@ -249,7 +249,7 @@ describe Budget::Investment do
|
||||
by_valuator = Budget::Investment.by_valuator(valuator1.id)
|
||||
|
||||
expect(by_valuator.size).to eq(2)
|
||||
expect(by_valuator.sort).to eq([investment1,investment3].sort)
|
||||
expect(by_valuator.sort).to eq([investment1, investment3].sort)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ describe Verification::Management::Email do
|
||||
|
||||
allow(validation).to receive(:user).and_return user
|
||||
expect(mail).to receive(:deliver_later)
|
||||
expect(Devise.token_generator).to receive(:generate).with(User, :email_verification_token).and_return(["1","2"])
|
||||
expect(Devise.token_generator).to receive(:generate).with(User, :email_verification_token).and_return(["1", "2"])
|
||||
expect(Mailer).to receive(:email_verification).with(user, user.email, "2", "1", "1234").and_return(mail)
|
||||
|
||||
validation.save
|
||||
|
||||
Reference in New Issue
Block a user