Add rubocop spacing rules

We were following these rules in most places; we just didn't define them
anywhere.
This commit is contained in:
Javi Martín
2019-06-22 18:11:23 +02:00
parent c7f64f8493
commit f9ed186909
264 changed files with 652 additions and 577 deletions

View File

@@ -7,7 +7,7 @@ describe "Cache flow" do
debate = create(:debate, tag_list: "Good, Bad")
tag = ActsAsTaggableOn::Tag.find_by(name: "Bad")
expect{tag.destroy}.to change {debate.reload.cache_key}
expect { tag.destroy }.to change { debate.reload.cache_key }
end
end

View File

@@ -4,7 +4,7 @@ describe CensusApi do
let(:api) { described_class.new }
describe "#call" do
let(:invalid_body) { {get_habita_datos_response: {get_habita_datos_return: {datos_habitante: {}}}} }
let(:invalid_body) { { get_habita_datos_response: { get_habita_datos_return: { datos_habitante: {}}}} }
let(:valid_body) do
{
get_habita_datos_response: {

View File

@@ -6,7 +6,7 @@ describe CensusCaller do
describe "#call" do
it "returns data from local_census_records if census API is not available" do
census_api_response = CensusApi::Response.new(get_habita_datos_response: {
get_habita_datos_return: { datos_habitante: {}, datos_vivienda: {} }
get_habita_datos_return: { datos_habitante: {}, datos_vivienda: {}}
}
)
@@ -26,7 +26,7 @@ describe CensusCaller do
it "returns data from census API if it's available and valid" do
census_api_response = CensusApi::Response.new(get_habita_datos_response: {
get_habita_datos_return: {
datos_habitante: { item: { fecha_nacimiento_string: "1-1-1980" } }
datos_habitante: { item: { fecha_nacimiento_string: "1-1-1980" }}
}
})
@@ -58,7 +58,7 @@ describe CensusCaller do
remote_census_api_response = RemoteCensusApi::Response.new(get_habita_datos_response: {
get_habita_datos_return: {
datos_habitante: { item: { fecha_nacimiento_string: "1-1-1980" } }
datos_habitante: { item: { fecha_nacimiento_string: "1-1-1980" }}
}
})
@@ -82,7 +82,7 @@ describe CensusCaller do
remote_census_api_response = RemoteCensusApi::Response.new(get_habita_datos_response: {
get_habita_datos_return: {
datos_habitante: { item: { fecha_nacimiento_string: "1-1-1980" } }
datos_habitante: { item: { fecha_nacimiento_string: "1-1-1980" }}
}
})

View File

@@ -3,7 +3,7 @@ require "rails_helper"
describe EvaluationCommentEmail do
let(:author) { create(:user) }
let(:administrator) { create(:administrator)}
let(:administrator) { create(:administrator) }
let(:investment) { create(:budget_investment, author: author, administrator: administrator) }
let(:commenter) { create(:user, email: "email@commenter.org") }
let(:comment) { create(:comment, commentable: investment, user: commenter) }

View File

@@ -3,8 +3,8 @@ require "rails_helper"
describe GraphQL::QueryTypeCreator do
let(:api_type_definitions) do
{
ProposalNotification => { fields: { title: :string } },
Proposal => { fields: { id: :integer, title: :string } }
ProposalNotification => { fields: { title: :string }},
Proposal => { fields: { id: :integer, title: :string }}
}
end
let(:api_types) { GraphQL::ApiTypesCreator.create(api_type_definitions) }

View File

@@ -435,7 +435,7 @@ describe "Consul Schema" do
describe "Geozones" do
it "returns geozones" do
geozone_names = [ create(:geozone), create(:geozone) ].map { |geozone| geozone.name }
geozone_names = [create(:geozone), create(:geozone)].map { |geozone| geozone.name }
response = execute("{ geozones { edges { node { name } } } }")
received_names = extract_fields(response, "geozones", "name")

View File

@@ -45,7 +45,7 @@ describe ManagerAuthenticator do
describe "SOAP" do
it "calls the verification user method" do
message = { ub: {user_key: "31415926", date: "20151031135905"} }
message = { ub: { user_key: "31415926", date: "20151031135905" }}
allow(authenticator).to receive(:application_authorized?).and_return(true)
allow(authenticator.send(:client)).to receive(:call).with(:get_status_user_data, message: message)
authenticator.auth
@@ -53,7 +53,7 @@ describe ManagerAuthenticator do
it "calls the permissions check method" do
allow(authenticator).to receive(:manager_exists?).and_return(true)
allow(authenticator.send(:client)).to receive(:call).with(:get_applications_user_list, message: { ub: {user_key: "31415926"} })
allow(authenticator.send(:client)).to receive(:call).with(:get_applications_user_list, message: { ub: { user_key: "31415926" }})
authenticator.auth
end
end

View File

@@ -4,7 +4,7 @@ describe RemoteCensusApi do
let(:api) { described_class.new }
describe "#call" do
let(:invalid_body) { {get_habita_datos_response: {get_habita_datos_return: {datos_habitante: {}}}} }
let(:invalid_body) { { get_habita_datos_response: { get_habita_datos_return: { datos_habitante: {}}}} }
let(:valid_body) do
{
get_habita_datos_response: {
@@ -86,33 +86,33 @@ describe RemoteCensusApi do
request = RemoteCensusApi.new.send(:request, document_type, document_number, nil, nil)
expect(request).to eq ({:request=>
{:codigo_institucion=>1,
:codigo_portal=>1,
:codigo_usuario=>1,
:documento=>"0123456",
:tipo_documento=>"1",
:codigo_idioma=>"102",
:nivel=>"3"}
expect(request).to eq ({ :request =>
{ :codigo_institucion => 1,
:codigo_portal => 1,
:codigo_usuario => 1,
:documento => "0123456",
:tipo_documento => "1",
:codigo_idioma => "102",
:nivel => "3" }
})
end
it "when send date_of_birth and postal_code but are not configured" do
document_type = "1"
document_number = "0123456"
date_of_birth = Date.new(1980, 1, 1)
date_of_birth = Date.new(1980, 1, 1)
postal_code = "28001"
request = RemoteCensusApi.new.send(:request, document_type, document_number, date_of_birth, postal_code)
expect(request).to eq ({:request=>
{:codigo_institucion=>1,
:codigo_portal=>1,
:codigo_usuario=>1,
:documento=>"0123456",
:tipo_documento=>"1",
:codigo_idioma=>"102",
:nivel=>"3"}
expect(request).to eq ({ :request =>
{ :codigo_institucion => 1,
:codigo_portal => 1,
:codigo_usuario => 1,
:documento => "0123456",
:tipo_documento => "1",
:codigo_idioma => "102",
:nivel => "3" }
})
end
@@ -132,21 +132,21 @@ describe RemoteCensusApi do
Setting["remote_census.request.postal_code"] = "request.codigo_postal"
document_type = "1"
document_number = "0123456"
date_of_birth = Date.new(1980, 1, 1)
date_of_birth = Date.new(1980, 1, 1)
postal_code = "28001"
request = RemoteCensusApi.new.send(:request, document_type, document_number, date_of_birth, postal_code)
expect(request).to eq ({:request=>
{:codigo_institucion=>1,
:codigo_portal=>1,
:codigo_usuario=>1,
:documento=>"0123456",
:tipo_documento=>"1",
:fecha_nacimiento=>"1980-01-01",
:codigo_postal=>"28001",
:codigo_idioma=>"102",
:nivel=>"3"}
expect(request).to eq ({ :request =>
{ :codigo_institucion => 1,
:codigo_portal => 1,
:codigo_usuario => 1,
:documento => "0123456",
:tipo_documento => "1",
:fecha_nacimiento => "1980-01-01",
:codigo_postal => "28001",
:codigo_idioma => "102",
:nivel => "3" }
})
end

View File

@@ -12,7 +12,7 @@ describe RemoteTranslations::Microsoft::Client do
expect_any_instance_of(TranslatorText::Client).to receive(:translate).and_return(response)
result = client.call([ "New title", "New description"], :es)
result = client.call(["New title", "New description"], :es)
expect(result).to eq(["Nuevo título", "Nueva descripción"])
end

View File

@@ -31,7 +31,7 @@ describe "Dashboards Rake" do
action.update(published_proposal: true)
resource.update(published_proposal: true)
expect {run_rake_task}.to change { ActionMailer::Base.deliveries.count }.by(0)
expect { run_rake_task }.to change { ActionMailer::Base.deliveries.count }.by(0)
end
it "when there are not news actions actived for draft proposals" do
@@ -39,7 +39,7 @@ describe "Dashboards Rake" do
action.update(published_proposal: false)
resource.update(published_proposal: false)
expect {run_rake_task}.to change { ActionMailer::Base.deliveries.count }.by(0)
expect { run_rake_task }.to change { ActionMailer::Base.deliveries.count }.by(0)
end
it "when there are news actions actived for archived proposals" do
@@ -47,7 +47,7 @@ describe "Dashboards Rake" do
action.update(day_offset: 0, published_proposal: true)
resource.update(day_offset: 0, published_proposal: true)
expect {run_rake_task}.to change { ActionMailer::Base.deliveries.count }.by(0)
expect { run_rake_task }.to change { ActionMailer::Base.deliveries.count }.by(0)
end
end

View File

@@ -8,7 +8,7 @@ describe UserSegments do
describe "#all_users" do
it "returns all active users enabled" do
active_user = create(:user)
erased_user = create(:user, erased_at: Time.current)
erased_user = create(:user, erased_at: Time.current)
expect(described_class.all_users).to include active_user
expect(described_class.all_users).not_to include erased_user