Fix all Style/HashSyntax rubocop issues and remove from rubocop_todo list

This commit is contained in:
Bertocq
2017-06-25 16:03:16 +02:00
parent c9bc028524
commit 904e3fdcfa
5 changed files with 19 additions and 15 deletions

View File

@@ -229,15 +229,6 @@ Layout/FirstParameterIndentation:
Style/GuardClause: Style/GuardClause:
Enabled: false Enabled: false
# Offense count: 10
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols.
# SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys
Style/HashSyntax:
Exclude:
- 'lib/sms_api.rb'
- 'spec/factories.rb'
# Offense count: 6 # Offense count: 6
# Cop supports --auto-correct. # Cop supports --auto-correct.
# Configuration parameters: MaxLineLength. # Configuration parameters: MaxLineLength.

View File

@@ -14,10 +14,10 @@ class SandboxController < ApplicationController
def show def show
if params[:template].index('.') # CVE-2014-0130 if params[:template].index('.') # CVE-2014-0130
render :action => "index" render action: "index"
elsif lookup_context.exists?("sandbox/#{params[:template]}") elsif lookup_context.exists?("sandbox/#{params[:template]}")
if params[:template] == "index" if params[:template] == "index"
render :action => "index" render action: "index"
else else
render "sandbox/#{params[:template]}" render "sandbox/#{params[:template]}"
end end
@@ -25,7 +25,7 @@ class SandboxController < ApplicationController
elsif lookup_context.exists?("sandbox/#{params[:template]}/index") elsif lookup_context.exists?("sandbox/#{params[:template]}/index")
render "sandbox/#{params[:template]}/index" render "sandbox/#{params[:template]}/index"
else else
render :action => "index" render action: "index"
end end
end end

View File

@@ -9,7 +9,7 @@ class Legislation::Question < ActiveRecord::Base
has_many :answers, class_name: 'Legislation::Answer', foreign_key: 'legislation_question_id', dependent: :destroy, inverse_of: :question has_many :answers, class_name: 'Legislation::Answer', foreign_key: 'legislation_question_id', dependent: :destroy, inverse_of: :question
has_many :comments, as: :commentable, dependent: :destroy has_many :comments, as: :commentable, dependent: :destroy
accepts_nested_attributes_for :question_options, :reject_if => proc { |attributes| attributes[:value].blank? }, allow_destroy: true accepts_nested_attributes_for :question_options, reject_if: proc { |attributes| attributes[:value].blank? }, allow_destroy: true
validates :process, presence: true validates :process, presence: true
validates :title, presence: true validates :title, presence: true

View File

@@ -38,7 +38,20 @@ class SMSApi
end end
def stubbed_response def stubbed_response
{:respuesta_sms => {:identificador_mensaje => "1234567", :fecha_respuesta => "Thu, 20 Aug 2015 16:28:05 +0200", :respuesta_pasarela => {:codigo_pasarela => "0000", :descripcion_pasarela => "Operación ejecutada correctamente."}, :respuesta_servicio_externo => {:codigo_respuesta => "1000", :texto_respuesta => "Success"}}} {
respuesta_sms: {
identificador_mensaje: "1234567",
fecha_respuesta: "Thu, 20 Aug 2015 16:28:05 +0200",
respuesta_pasarela: {
codigo_pasarela: "0000",
descripcion_pasarela: "Operación ejecutada correctamente."
},
respuesta_servicio_externo: {
codigo_respuesta: "1000",
texto_respuesta: "Success"
}
}
}
end end
end end

View File

@@ -552,7 +552,7 @@ FactoryGirl.define do
sequence(:value) { |n| "Setting #{n} Value" } sequence(:value) { |n| "Setting #{n} Value" }
end end
factory :ahoy_event, :class => Ahoy::Event do factory :ahoy_event, class: Ahoy::Event do
id { SecureRandom.uuid } id { SecureRandom.uuid }
time DateTime.current time DateTime.current
sequence(:name) {|n| "Event #{n} type"} sequence(:name) {|n| "Event #{n} type"}