Enable the Layout/DotPosition cop

This commit is contained in:
gregoirenovel 2017-06-12 15:16:15 +02:00
parent f2cf32a15c
commit a62d5322b6
7 changed files with 30 additions and 30 deletions

View file

@ -31,7 +31,7 @@ Layout/CommentIndentation:
Enabled: true Enabled: true
Layout/DotPosition: Layout/DotPosition:
Enabled: false Enabled: true
Layout/ElseAlignment: Layout/ElseAlignment:
Enabled: true Enabled: true

View file

@ -57,8 +57,8 @@ describe RootController, type: :controller do
render_views render_views
before do before do
stub_request(:get, "https://api.github.com/repos/sgmap/tps/releases/latest"). stub_request(:get, "https://api.github.com/repos/sgmap/tps/releases/latest")
to_return(:status => 200, :body => '{"tag_name": "plip", "body": "blabla", "published_at": "2016-02-09T16:46:47Z"}', :headers => {}) .to_return(:status => 200, :body => '{"tag_name": "plip", "body": "blabla", "published_at": "2016-02-09T16:46:47Z"}', :headers => {})
subject subject
end end

View file

@ -81,9 +81,9 @@ shared_examples 'carte_controller_spec' do
let(:module_api_carto) { create(:module_api_carto, :with_quartiers_prioritaires) } let(:module_api_carto) { create(:module_api_carto, :with_quartiers_prioritaires) }
before do before do
allow_any_instance_of(CARTO::SGMAP::QuartiersPrioritaires::Adapter). allow_any_instance_of(CARTO::SGMAP::QuartiersPrioritaires::Adapter)
to receive(:to_params). .to receive(:to_params)
and_return({"QPCODE1234" => {:code => "QPCODE1234", :nom => "QP de test", :commune => "Paris", :geometry => {:type => "MultiPolygon", :coordinates => [[[[2.38715792094576, 48.8723062632126], [2.38724851642619, 48.8721392348061]]]]}}}) .and_return({"QPCODE1234" => {:code => "QPCODE1234", :nom => "QP de test", :commune => "Paris", :geometry => {:type => "MultiPolygon", :coordinates => [[[[2.38715792094576, 48.8723062632126], [2.38724851642619, 48.8721392348061]]]]}}})
post :save, params: {dossier_id: dossier.id, json_latlngs: json_latlngs} post :save, params: {dossier_id: dossier.id, json_latlngs: json_latlngs}
end end
@ -128,9 +128,9 @@ shared_examples 'carte_controller_spec' do
let(:module_api_carto) { create(:module_api_carto, :with_cadastre) } let(:module_api_carto) { create(:module_api_carto, :with_cadastre) }
before do before do
allow_any_instance_of(CARTO::SGMAP::Cadastre::Adapter). allow_any_instance_of(CARTO::SGMAP::Cadastre::Adapter)
to receive(:to_params). .to receive(:to_params)
and_return([{:surface_intersection => "0.0006", :surface_parcelle => 11252.692583090324, :numero => "0013", :feuille => 1, :section => "CD", :code_dep => "30", :nom_com => "Le Grau-du-Roi", :code_com => "133", :code_arr => "000", :geometry => {:type => "MultiPolygon", :coordinates => [[[[4.134084, 43.5209193], [4.1346615, 43.5212035], [4.1346984, 43.521189], [4.135096, 43.5213848], [4.1350839, 43.5214122], [4.1352697, 43.521505], [4.1356278, 43.5211065], [4.1357402, 43.5207188], [4.1350935, 43.5203936], [4.135002, 43.5204366], [4.1346051, 43.5202412], [4.134584, 43.5202472], [4.1345572, 43.5202551], [4.134356, 43.5203137], [4.1342488, 43.5203448], [4.134084, 43.5209193]]]]}}]) .and_return([{:surface_intersection => "0.0006", :surface_parcelle => 11252.692583090324, :numero => "0013", :feuille => 1, :section => "CD", :code_dep => "30", :nom_com => "Le Grau-du-Roi", :code_com => "133", :code_arr => "000", :geometry => {:type => "MultiPolygon", :coordinates => [[[[4.134084, 43.5209193], [4.1346615, 43.5212035], [4.1346984, 43.521189], [4.135096, 43.5213848], [4.1350839, 43.5214122], [4.1352697, 43.521505], [4.1356278, 43.5211065], [4.1357402, 43.5207188], [4.1350935, 43.5203936], [4.135002, 43.5204366], [4.1346051, 43.5202412], [4.134584, 43.5202472], [4.1345572, 43.5202551], [4.134356, 43.5203137], [4.1342488, 43.5203448], [4.134084, 43.5209193]]]]}}])
post :save, params: {dossier_id: dossier.id, json_latlngs: json_latlngs} post :save, params: {dossier_id: dossier.id, json_latlngs: json_latlngs}
end end
@ -244,9 +244,9 @@ shared_examples 'carte_controller_spec' do
describe 'POST #get_qp' do describe 'POST #get_qp' do
before do before do
allow_any_instance_of(CARTO::SGMAP::QuartiersPrioritaires::Adapter). allow_any_instance_of(CARTO::SGMAP::QuartiersPrioritaires::Adapter)
to receive(:to_params). .to receive(:to_params)
and_return({"QPCODE1234" => {:code => "QPCODE1234", :geometry => {:type => "MultiPolygon", :coordinates => [[[[2.38715792094576, 48.8723062632126], [2.38724851642619, 48.8721392348061]]]]}}}) .and_return({"QPCODE1234" => {:code => "QPCODE1234", :geometry => {:type => "MultiPolygon", :coordinates => [[[[2.38715792094576, 48.8723062632126], [2.38724851642619, 48.8721392348061]]]]}}})
post :get_qp, params: {dossier_id: dossier.id, coordinates: coordinates} post :get_qp, params: {dossier_id: dossier.id, coordinates: coordinates}
end end

View file

@ -30,8 +30,8 @@ feature 'Administrator connection' do
end end
context 'when clicking on sign-out' do context 'when clicking on sign-out' do
before do before do
stub_request(:get, "https://api.github.com/repos/sgmap/tps/releases/latest"). stub_request(:get, "https://api.github.com/repos/sgmap/tps/releases/latest")
to_return(:status => 200, :body => '{"tag_name": "plip", "body": "blabla", "published_at": "2016-02-09T16:46:47Z"}', :headers => {}) .to_return(:status => 200, :body => '{"tag_name": "plip", "body": "blabla", "published_at": "2016-02-09T16:46:47Z"}', :headers => {})
page.find_by_id('sign-out').find('a.fa-sign-out').click page.find_by_id('sign-out').find('a.fa-sign-out').click
end end

View file

@ -5,10 +5,10 @@ describe CARTO::SGMAP::API do
subject { described_class.search_qp(geojson) } subject { described_class.search_qp(geojson) }
before do before do
stub_request(:post, "https://apicarto.sgmap.fr/quartiers-prioritaires/search"). stub_request(:post, "https://apicarto.sgmap.fr/quartiers-prioritaires/search")
with(:body => /.*/, .with(:body => /.*/,
:headers => {'Content-Type'=>'application/json'}). :headers => {'Content-Type'=>'application/json'})
to_return(status: status, body: body) .to_return(status: status, body: body)
end end
context 'when geojson is empty' do context 'when geojson is empty' do
let(:geojson) { '' } let(:geojson) { '' }
@ -53,10 +53,10 @@ describe CARTO::SGMAP::API do
subject { described_class.search_cadastre(geojson) } subject { described_class.search_cadastre(geojson) }
before do before do
stub_request(:post, "https://apicarto.sgmap.fr/cadastre/geometrie"). stub_request(:post, "https://apicarto.sgmap.fr/cadastre/geometrie")
with(:body => /.*/, .with(:body => /.*/,
:headers => {'Content-Type'=>'application/json'}). :headers => {'Content-Type'=>'application/json'})
to_return(status: status, body: body) .to_return(status: status, body: body)
end end
context 'when geojson is empty' do context 'when geojson is empty' do
let(:geojson) { '' } let(:geojson) { '' }

View file

@ -4,10 +4,10 @@ describe CARTO::SGMAP::Cadastre::Adapter do
subject { described_class.new(coordinates).to_params } subject { described_class.new(coordinates).to_params }
before do before do
stub_request(:post, "https://apicarto.sgmap.fr/cadastre/geometrie"). stub_request(:post, "https://apicarto.sgmap.fr/cadastre/geometrie")
with(:body => /.*/, .with(:body => /.*/,
:headers => {'Content-Type' => 'application/json'}). :headers => {'Content-Type' => 'application/json'})
to_return(status: status, body: body) .to_return(status: status, body: body)
end end
context 'coordinates are filled' do context 'coordinates are filled' do

View file

@ -4,10 +4,10 @@ describe CARTO::SGMAP::QuartiersPrioritaires::Adapter do
subject { described_class.new(coordinates).to_params } subject { described_class.new(coordinates).to_params }
before do before do
stub_request(:post, "https://apicarto.sgmap.fr/quartiers-prioritaires/search"). stub_request(:post, "https://apicarto.sgmap.fr/quartiers-prioritaires/search")
with(:body => /.*/, .with(:body => /.*/,
:headers => {'Content-Type' => 'application/json'}). :headers => {'Content-Type' => 'application/json'})
to_return(status: status, body: body) .to_return(status: status, body: body)
end end
context 'coordinates are filled' do context 'coordinates are filled' do