Add and apply ParenthesesAsGroupedExpression rule
This commit is contained in:
@@ -126,6 +126,9 @@ Lint/DuplicateMethods:
|
||||
Lint/LiteralAsCondition:
|
||||
Enabled: true
|
||||
|
||||
Lint/ParenthesesAsGroupedExpression:
|
||||
Enabled: true
|
||||
|
||||
Lint/ShadowingOuterLocalVariable:
|
||||
Enabled: true
|
||||
|
||||
|
||||
@@ -34,13 +34,13 @@ class RemoteTranslations::Microsoft::AvailableLocales
|
||||
host = "https://api.cognitive.microsofttranslator.com"
|
||||
path = "/languages?api-version=3.0"
|
||||
|
||||
uri = URI (host + path)
|
||||
uri = URI(host + path)
|
||||
|
||||
request = Net::HTTP::Get.new(uri)
|
||||
request["Ocp-Apim-Subscription-Key"] = Rails.application.secrets.microsoft_api_key
|
||||
|
||||
response = Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == "https") do |http|
|
||||
http.request (request)
|
||||
http.request(request)
|
||||
end
|
||||
|
||||
result = response.body.force_encoding("utf-8")
|
||||
|
||||
@@ -73,7 +73,7 @@ describe "Admin dashboard actions" do
|
||||
|
||||
before do
|
||||
visit admin_dashboard_actions_path
|
||||
within ("#dashboard_action_#{action.id}") do
|
||||
within "#dashboard_action_#{action.id}" do
|
||||
click_link "Edit"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -51,13 +51,13 @@ describe "Admin collaborative legislation" do
|
||||
|
||||
visit admin_legislation_processes_path(filter: "all")
|
||||
|
||||
expect(page).to have_content (process_1.start_date)
|
||||
expect(page).to have_content (process_2.start_date)
|
||||
expect(page).to have_content (process_3.start_date)
|
||||
expect(page).to have_content process_1.start_date
|
||||
expect(page).to have_content process_2.start_date
|
||||
expect(page).to have_content process_3.start_date
|
||||
|
||||
expect(page).to have_content (process_1.end_date)
|
||||
expect(page).to have_content (process_2.end_date)
|
||||
expect(page).to have_content (process_3.end_date)
|
||||
expect(page).to have_content process_1.end_date
|
||||
expect(page).to have_content process_2.end_date
|
||||
expect(page).to have_content process_3.end_date
|
||||
|
||||
expect(process_3.title).to appear_before(process_2.title)
|
||||
expect(process_2.title).to appear_before(process_1.title)
|
||||
|
||||
@@ -161,7 +161,7 @@ describe "Cards" do
|
||||
card_2 = create(:widget_card, page: custom_page, title: "Card medium", columns: 4)
|
||||
card_3 = create(:widget_card, page: custom_page, title: "Card small", columns: 2)
|
||||
|
||||
visit (custom_page).url
|
||||
visit custom_page.url
|
||||
|
||||
expect(page).to have_css(".card", count: 3)
|
||||
|
||||
@@ -174,7 +174,7 @@ describe "Cards" do
|
||||
card_1 = create(:widget_card, page: custom_page, title: "Card one", label: "My label")
|
||||
card_2 = create(:widget_card, page: custom_page, title: "Card two")
|
||||
|
||||
visit (custom_page).url
|
||||
visit custom_page.url
|
||||
|
||||
within("#widget_card_#{card_1.id}") do
|
||||
expect(page).to have_selector("span", text: "My label")
|
||||
|
||||
@@ -86,15 +86,15 @@ 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
|
||||
@@ -105,15 +105,15 @@ describe RemoteCensusApi do
|
||||
|
||||
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
|
||||
|
||||
it "when send date_of_birth and postal_code but are configured" do
|
||||
@@ -137,17 +137,17 @@ describe RemoteCensusApi do
|
||||
|
||||
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
|
||||
|
||||
end
|
||||
@@ -164,26 +164,26 @@ describe RemoteCensusApi do
|
||||
|
||||
response = RemoteCensusApi.new.send(:get_response_body, document_type, document_number, nil, nil)
|
||||
|
||||
expect(response).to eq ({ get_habita_datos_response: {
|
||||
get_habita_datos_return: {
|
||||
datos_habitante: {
|
||||
item: {
|
||||
fecha_nacimiento_string: "31-12-1980",
|
||||
identificador_documento: "12345678Z",
|
||||
descripcion_sexo: "Varón",
|
||||
nombre: "José",
|
||||
apellido1: "García"
|
||||
}
|
||||
},
|
||||
datos_vivienda: {
|
||||
item: {
|
||||
codigo_postal: "28013",
|
||||
codigo_distrito: "01"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
expect(response).to eq({ get_habita_datos_response: {
|
||||
get_habita_datos_return: {
|
||||
datos_habitante: {
|
||||
item: {
|
||||
fecha_nacimiento_string: "31-12-1980",
|
||||
identificador_documento: "12345678Z",
|
||||
descripcion_sexo: "Varón",
|
||||
nombre: "José",
|
||||
apellido1: "García"
|
||||
}
|
||||
},
|
||||
datos_vivienda: {
|
||||
item: {
|
||||
codigo_postal: "28013",
|
||||
codigo_distrito: "01"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -171,7 +171,7 @@ describe Budget::Phase do
|
||||
second_phase.update_attributes(enabled: false,
|
||||
starts_at: Date.current,
|
||||
ends_at: Date.current + 2.days)
|
||||
end.not_to (change { prev_enabled_phase.ends_at })
|
||||
end.not_to change { prev_enabled_phase.ends_at }
|
||||
end
|
||||
|
||||
it "adjusts next enabled phase start date to its own start date" do
|
||||
|
||||
@@ -277,28 +277,28 @@ describe Budget do
|
||||
budget.update(currency_symbol: "€")
|
||||
I18n.locale = :es
|
||||
|
||||
expect(budget.formatted_amount(1000.00)).to eq ("1.000 €")
|
||||
expect(budget.formatted_amount(1000.00)).to eq "1.000 €"
|
||||
end
|
||||
|
||||
it "correctly formats Dollars with Spanish" do
|
||||
budget.update(currency_symbol: "$")
|
||||
I18n.locale = :es
|
||||
|
||||
expect(budget.formatted_amount(1000.00)).to eq ("1.000 $")
|
||||
expect(budget.formatted_amount(1000.00)).to eq "1.000 $"
|
||||
end
|
||||
|
||||
it "correctly formats Dollars with English" do
|
||||
budget.update(currency_symbol: "$")
|
||||
I18n.locale = :en
|
||||
|
||||
expect(budget.formatted_amount(1000.00)).to eq ("$1,000")
|
||||
expect(budget.formatted_amount(1000.00)).to eq "$1,000"
|
||||
end
|
||||
|
||||
it "correctly formats Euros with English" do
|
||||
budget.update(currency_symbol: "€")
|
||||
I18n.locale = :en
|
||||
|
||||
expect(budget.formatted_amount(1000.00)).to eq ("€1,000")
|
||||
expect(budget.formatted_amount(1000.00)).to eq "€1,000"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ shared_examples_for "sluggable" do |updatable_slug_trait:|
|
||||
context "slug updating condition is false" do
|
||||
it "slug isn't updated" do
|
||||
expect { sluggable.update_attributes(name: "New Name") }
|
||||
.not_to (change { sluggable.slug })
|
||||
.not_to change { sluggable.slug }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user