Fix all Style/HashSyntax rubocop issues and remove from rubocop_todo list
This commit is contained in:
@@ -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.
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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"}
|
||||||
|
|||||||
Reference in New Issue
Block a user