Merge pull request #664 from sgmap/rubocop_spacing_rule
Rubocop: enable Layout/SpaceAroundOperators
This commit is contained in:
commit
8ff275659b
14 changed files with 27 additions and 27 deletions
|
@ -170,7 +170,7 @@ Layout/SpaceAroundKeyword:
|
|||
Enabled: false
|
||||
|
||||
Layout/SpaceAroundOperators:
|
||||
Enabled: false
|
||||
Enabled: true
|
||||
|
||||
Layout/SpaceBeforeBlockBraces:
|
||||
Enabled: false
|
||||
|
|
|
@ -8,7 +8,7 @@ class PreferenceListDossier < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def table_with_s_attr
|
||||
return 'dossiers.'+self.attr if table.nil? || table.empty?
|
||||
return 'dossiers.' + self.attr if table.nil? || table.empty?
|
||||
table + 's' + '.' + attr
|
||||
end
|
||||
|
||||
|
|
|
@ -137,7 +137,7 @@ class DossiersListGestionnaireService
|
|||
filter_preference_list.inject('') do |acc, preference|
|
||||
unless preference.filter.blank?
|
||||
filter = preference.filter.gsub('*', '%').gsub("'", "''")
|
||||
filter = "%"+filter+"%" unless filter.include? '%'
|
||||
filter = "%" + filter + "%" unless filter.include? '%'
|
||||
|
||||
value = preference.table_with_s_attr
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ class RenderPartialService
|
|||
def self.left_panel_exist? left_panel_url
|
||||
file = left_panel_url.split('/').last
|
||||
|
||||
File.exist?(Rails.root.join('app','views', 'layouts', 'left_panels', '_'+file+'.html.haml'))
|
||||
File.exist?(Rails.root.join('app','views', 'layouts', 'left_panels', '_' + file + '.html.haml'))
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
@ -3,7 +3,7 @@ class SiretFormatValidator < ActiveModel::EachValidator
|
|||
unless value =~ /^\d{14}$/
|
||||
record.errors.add(attribute, :format)
|
||||
end
|
||||
unless value!= nil && (luhn_checksum(value) % 10 == 0)
|
||||
unless value != nil && (luhn_checksum(value) % 10 == 0)
|
||||
record.errors.add(attribute, :checksum)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -9,7 +9,7 @@ Rails.application.configure do
|
|||
# Do not eager load code on boot.
|
||||
config.eager_load = false
|
||||
|
||||
config.public_file_server.enabled = true
|
||||
config.public_file_server.enabled = true
|
||||
config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' }
|
||||
|
||||
# Show full error reports and disable caching.
|
||||
|
|
|
@ -13,7 +13,7 @@ Rails.application.configure do
|
|||
config.eager_load = false
|
||||
|
||||
# Configure static file server for tests with Cache-Control for performance.
|
||||
config.public_file_server.enabled = true
|
||||
config.public_file_server.enabled = true
|
||||
config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' }
|
||||
|
||||
# Show full error reports and disable caching.
|
||||
|
|
|
@ -27,7 +27,7 @@ CarrierWave.configure do |config|
|
|||
if Rails.env.production?
|
||||
config.fog_directory = "tps"
|
||||
elsif Rails.env.development?
|
||||
config.fog_directory= "test_local"
|
||||
config.fog_directory = "test_local"
|
||||
else
|
||||
config.fog_directory = "tps_dev"
|
||||
end
|
||||
|
|
|
@ -10,7 +10,7 @@ SmartListing.configure do |config|
|
|||
# :unlimited_per_page => false, # allow infinite page size
|
||||
# :paginate => true, # allow pagination
|
||||
# :memorize_per_page => false, # save per page settings in the cookie
|
||||
:page_sizes => [10, 20, 50, 100], # set available page sizes array
|
||||
:page_sizes => [10, 20, 50, 100], # set available page sizes array
|
||||
# :kaminari_options => {:theme => "smart_listing"}, # Kaminari's paginate helper options
|
||||
})
|
||||
|
||||
|
|
|
@ -248,7 +248,7 @@ shared_examples 'description_controller_spec' do
|
|||
it { expect(response).to redirect_to users_dossier_recapitulatif_path }
|
||||
|
||||
context 'when champs is type_de_champ datetime' do
|
||||
it { expect(dossier.champs.second.value).to eq(dossier_date_value+' '+dossier_hour_value+':'+dossier_minute_value) }
|
||||
it { expect(dossier.champs.second.value).to eq(dossier_date_value + ' ' + dossier_hour_value + ':' + dossier_minute_value) }
|
||||
end
|
||||
|
||||
context 'when champs value is empty' do
|
||||
|
@ -270,8 +270,8 @@ shared_examples 'description_controller_spec' do
|
|||
let(:all_pj_type) { dossier.procedure.type_de_piece_justificative_ids }
|
||||
before do
|
||||
post :update, params: {dossier_id: dossier_id,
|
||||
'piece_justificative_'+all_pj_type[0].to_s => piece_justificative_0,
|
||||
'piece_justificative_'+all_pj_type[1].to_s => piece_justificative_1}
|
||||
'piece_justificative_' + all_pj_type[0].to_s => piece_justificative_0,
|
||||
'piece_justificative_' + all_pj_type[1].to_s => piece_justificative_1}
|
||||
dossier.reload
|
||||
end
|
||||
|
||||
|
@ -280,8 +280,8 @@ shared_examples 'description_controller_spec' do
|
|||
expect(ClamavService).to receive(:safe_file?).twice
|
||||
|
||||
post :update, params: {dossier_id: dossier_id,
|
||||
'piece_justificative_'+all_pj_type[0].to_s => piece_justificative_0,
|
||||
'piece_justificative_'+all_pj_type[1].to_s => piece_justificative_1}
|
||||
'piece_justificative_' + all_pj_type[0].to_s => piece_justificative_0,
|
||||
'piece_justificative_' + all_pj_type[1].to_s => piece_justificative_1}
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -318,8 +318,8 @@ shared_examples 'description_controller_spec' do
|
|||
let(:all_pj_type) { dossier.procedure.type_de_piece_justificative_ids }
|
||||
|
||||
subject { patch :pieces_justificatives, params: {dossier_id: dossier.id,
|
||||
'piece_justificative_'+all_pj_type[0].to_s => piece_justificative_0,
|
||||
'piece_justificative_'+all_pj_type[1].to_s => piece_justificative_1}
|
||||
'piece_justificative_' + all_pj_type[0].to_s => piece_justificative_0,
|
||||
'piece_justificative_' + all_pj_type[1].to_s => piece_justificative_1}
|
||||
}
|
||||
|
||||
context 'when user is a guest' do
|
||||
|
@ -394,8 +394,8 @@ shared_examples 'description_controller_spec_POST_piece_justificatives_for_owner
|
|||
let(:all_pj_type) { dossier.procedure.type_de_piece_justificative_ids }
|
||||
|
||||
subject { patch :pieces_justificatives, params: {dossier_id: dossier.id,
|
||||
'piece_justificative_'+all_pj_type[0].to_s => piece_justificative_0,
|
||||
'piece_justificative_'+all_pj_type[1].to_s => piece_justificative_1}
|
||||
'piece_justificative_' + all_pj_type[0].to_s => piece_justificative_0,
|
||||
'piece_justificative_' + all_pj_type[1].to_s => piece_justificative_1}
|
||||
}
|
||||
|
||||
context 'when user is the owner', vcr: {cassette_name: 'controllers_users_description_controller_pieces_justificatives'} do
|
||||
|
|
|
@ -40,22 +40,22 @@ feature 'usage of pref list dossier lateral panel by procedure', js: true do
|
|||
|
||||
context 'when on click on add attribut specific at the procedure button' do
|
||||
before do
|
||||
page.click_on 'add_pref_list_champs_'+procedure.types_de_champ.first.id.to_s
|
||||
page.click_on 'add_pref_list_champs_' + procedure.types_de_champ.first.id.to_s
|
||||
end
|
||||
|
||||
scenario 'preference list panel is brought up to date' do
|
||||
wait_for_ajax
|
||||
expect(page).to have_css('#delete_pref_list_champs_'+procedure.types_de_champ.first.id.to_s)
|
||||
expect(page).to have_css('#delete_pref_list_champs_' + procedure.types_de_champ.first.id.to_s)
|
||||
end
|
||||
|
||||
context 'when on click on delete attribut button' do
|
||||
before do
|
||||
page.click_on 'delete_pref_list_champs_'+procedure.types_de_champ.first.id.to_s
|
||||
page.click_on 'delete_pref_list_champs_' + procedure.types_de_champ.first.id.to_s
|
||||
end
|
||||
|
||||
scenario 'preference list panel is brought up to date' do
|
||||
wait_for_ajax
|
||||
expect(page).not_to have_css('#delete_pref_list_champs_'+procedure.types_de_champ.first.id.to_s)
|
||||
expect(page).not_to have_css('#delete_pref_list_champs_' + procedure.types_de_champ.first.id.to_s)
|
||||
end
|
||||
|
||||
scenario 'dossier is brought up to date' do
|
||||
|
|
|
@ -7,7 +7,7 @@ describe CARTO::SGMAP::API do
|
|||
before do
|
||||
stub_request(:post, "https://apicarto.sgmap.fr/quartiers-prioritaires/search")
|
||||
.with(:body => /.*/,
|
||||
:headers => {'Content-Type'=>'application/json'})
|
||||
:headers => {'Content-Type' => 'application/json'})
|
||||
.to_return(status: status, body: body)
|
||||
end
|
||||
context 'when geojson is empty' do
|
||||
|
@ -55,7 +55,7 @@ describe CARTO::SGMAP::API do
|
|||
before do
|
||||
stub_request(:post, "https://apicarto.sgmap.fr/cadastre/geometrie")
|
||||
.with(:body => /.*/,
|
||||
:headers => {'Content-Type'=>'application/json'})
|
||||
:headers => {'Content-Type' => 'application/json'})
|
||||
.to_return(status: status, body: body)
|
||||
end
|
||||
context 'when geojson is empty' do
|
||||
|
|
|
@ -26,7 +26,7 @@ describe CARTO::SGMAP::QuartiersPrioritaires::Adapter do
|
|||
it { expect(subject[:nom]).to eq('Hauts De Vallières') }
|
||||
it { expect(subject[:commune]).to eq('Metz') }
|
||||
|
||||
it { expect(subject[:geometry]).to eq({:type=>"MultiPolygon", :coordinates=>[[[[6.2136923480551, 49.1342109827851], [6.21416055031881, 49.1338823553928]]]]}) }
|
||||
it { expect(subject[:geometry]).to eq({:type => "MultiPolygon", :coordinates => [[[[6.2136923480551, 49.1342109827851], [6.21416055031881, 49.1338823553928]]]]}) }
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -8,12 +8,12 @@ describe RenderPartialService do
|
|||
describe 'navbar' do
|
||||
subject { service.navbar }
|
||||
|
||||
it { is_expected.to eq 'layouts/navbars/navbar_'+controller.to_s.parameterize + '_' + method.to_s }
|
||||
it { is_expected.to eq 'layouts/navbars/navbar_' + controller.to_s.parameterize + '_' + method.to_s }
|
||||
end
|
||||
|
||||
describe 'left_panel' do
|
||||
subject { service.left_panel }
|
||||
|
||||
it { is_expected.to eq 'layouts/left_panels/left_panel_'+controller.to_s.parameterize + '_' + method.to_s }
|
||||
it { is_expected.to eq 'layouts/left_panels/left_panel_' + controller.to_s.parameterize + '_' + method.to_s }
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue