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/concerns/commentable_actions.rb'
|
||||||
- 'app/controllers/verification/sms_controller.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
|
# Offense count: 20
|
||||||
# Cop supports --auto-correct.
|
# Cop supports --auto-correct.
|
||||||
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ class Admin::UsersController < Admin::BaseController
|
|||||||
def index
|
def index
|
||||||
if params[:search]
|
if params[:search]
|
||||||
s = 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
|
else
|
||||||
@users = @users.page(params[:page])
|
@users = @users.page(params[:page])
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ module Ahoy
|
|||||||
# chart
|
# chart
|
||||||
def add(name, collection)
|
def add(name, collection)
|
||||||
collections.push data: collection, name: name
|
collections.push data: collection, name: name
|
||||||
collection.each{ |k,v| add_key k }
|
collection.each{ |k, v| add_key k }
|
||||||
end
|
end
|
||||||
|
|
||||||
def build
|
def build
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ module SearchCache
|
|||||||
|
|
||||||
def searchable_values_sql
|
def searchable_values_sql
|
||||||
searchable_values
|
searchable_values
|
||||||
.select{ |k,_| k.present? }
|
.select{ |k, _| k.present? }
|
||||||
.collect{ |value, weight| set_tsvector(value, weight) }
|
.collect{ |value, weight| set_tsvector(value, weight) }
|
||||||
.join(" || ")
|
.join(" || ")
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ module Taggable
|
|||||||
def tag_list_with_limit(limit = nil)
|
def tag_list_with_limit(limit = nil)
|
||||||
return tags if limit.blank?
|
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
|
end
|
||||||
|
|
||||||
def tags_count_out_of_limit(limit = nil)
|
def tags_count_out_of_limit(limit = nil)
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ class SpendingProposal < ActiveRecord::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.filter_params(params)
|
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
|
end
|
||||||
|
|
||||||
def self.scoped_filter(params, current_filter)
|
def self.scoped_filter(params, current_filter)
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ class User < ActiveRecord::Base
|
|||||||
username: auth.info.name || auth.uid,
|
username: auth.info.name || auth.uid,
|
||||||
email: oauth_email,
|
email: oauth_email,
|
||||||
oauth_email: oauth_email,
|
oauth_email: oauth_email,
|
||||||
password: Devise.friendly_token[0,20],
|
password: Devise.friendly_token[0, 20],
|
||||||
terms_of_service: '1',
|
terms_of_service: '1',
|
||||||
confirmed_at: oauth_email_confirmed ? DateTime.current : nil
|
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|
|
question_2.valid_answers.each_with_index do |answer, i|
|
||||||
within("#question_#{question_2.id}_#{i}_result") do
|
within("#question_#{question_2.id}_#{i}_result") do
|
||||||
expect(page).to have_content(answer)
|
expect(page).to have_content(answer)
|
||||||
expect(page).to have_content([0,15][i])
|
expect(page).to have_content([0, 15][i])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ feature 'Users' do
|
|||||||
expect(user).to be_level_three_verified
|
expect(user).to be_level_three_verified
|
||||||
expect(user).to be_residence_verified
|
expect(user).to be_residence_verified
|
||||||
expect(user).to_not be_confirmed
|
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]
|
sent_token = /.*confirmation_token=(.*)".*/.match(ActionMailer::Base.deliveries.last.body.to_s)[1]
|
||||||
visit user_confirmation_path(confirmation_token: sent_token)
|
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_level_three_verified
|
||||||
expect(user).to be_residence_verified
|
expect(user).to be_residence_verified
|
||||||
expect(user).to be_confirmed
|
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
|
end
|
||||||
|
|
||||||
scenario 'Delete a level 2 user account from document verification page', :js do
|
scenario 'Delete a level 2 user account from document verification page', :js do
|
||||||
|
|||||||
@@ -289,9 +289,9 @@ feature 'Valuation budget investments' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
scenario 'Feasibility selection makes proper fields visible', :js do
|
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']
|
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
|
undecided_fields = feasible_fields + unfeasible_fields + any_feasibility_fields
|
||||||
|
|
||||||
visit edit_valuation_budget_budget_investment_path(@budget, @investment)
|
visit edit_valuation_budget_budget_investment_path(@budget, @investment)
|
||||||
|
|||||||
@@ -311,9 +311,9 @@ feature 'Valuation spending proposals' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
scenario 'Feasibility selection makes proper fields visible', :js do
|
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_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
|
feasible_nil_fields = feasible_true_fields + feasible_false_fields + feasible_any_fields
|
||||||
|
|
||||||
visit edit_valuation_spending_proposal_path(@spending_proposal)
|
visit edit_valuation_spending_proposal_path(@spending_proposal)
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ describe CensusApi do
|
|||||||
response = api.call(1, "123456")
|
response = api.call(1, "123456")
|
||||||
|
|
||||||
expect(response).to be_valid
|
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
|
end
|
||||||
|
|
||||||
it "returns the last failed response" do
|
it "returns the last failed response" do
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ describe "Abilities::Moderator" do
|
|||||||
describe "hiding, reviewing and restoring" do
|
describe "hiding, reviewing and restoring" do
|
||||||
let(:ignored_comment) { create(:comment, :with_ignored_flag) }
|
let(:ignored_comment) { create(:comment, :with_ignored_flag) }
|
||||||
let(:ignored_debate) { create(:debate, :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, comment) }
|
||||||
it { should be_able_to(:hide_in_moderation_screen, 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)
|
by_valuator = Budget::Investment.by_valuator(valuator1.id)
|
||||||
|
|
||||||
expect(by_valuator.size).to eq(2)
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ describe Verification::Management::Email do
|
|||||||
|
|
||||||
allow(validation).to receive(:user).and_return user
|
allow(validation).to receive(:user).and_return user
|
||||||
expect(mail).to receive(:deliver_later)
|
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)
|
expect(Mailer).to receive(:email_verification).with(user, user.email, "2", "1", "1234").and_return(mail)
|
||||||
|
|
||||||
validation.save
|
validation.save
|
||||||
|
|||||||
Reference in New Issue
Block a user