From 9439e1abb131b451e92c812076b4728d3f1ff5ee Mon Sep 17 00:00:00 2001 From: gregoirenovel Date: Mon, 12 Jun 2017 13:49:51 +0200 Subject: [PATCH] Enable the Layout/AlignParameters cop --- .rubocop.yml | 3 +- .../admin/accompagnateurs_controller.rb | 12 ++--- .../admin/gestionnaires_controller.rb | 7 +-- .../admin/procedures_controller.rb | 18 +++---- app/controllers/administrations_controller.rb | 8 ++- .../backoffice/dossiers_controller.rb | 16 +++--- .../backoffice/dossiers_list_controller.rb | 8 +-- app/controllers/backoffice_controller.rb | 12 ++--- app/controllers/commentaires_controller.rb | 6 +-- app/controllers/demo_controller.rb | 6 +-- app/controllers/users/dossiers_controller.rb | 6 +-- app/controllers/users_controller.rb | 4 +- app/lib/carto/sgmap/api.rb | 4 +- app/models/administrateur.rb | 2 +- app/models/gestionnaire.rb | 2 +- app/models/piece_justificative.rb | 2 +- app/models/user.rb | 2 +- app/serializers/cerfa_serializer.rb | 2 +- app/serializers/commentaire_serializer.rb | 4 +- app/serializers/dossier_serializer.rb | 22 ++++---- .../dossier_table_export_serializer.rb | 22 ++++---- app/serializers/dossiers_serializer.rb | 2 +- app/serializers/entreprise_serializer.rb | 22 ++++---- app/serializers/etablissement_serializer.rb | 23 ++++----- .../module_api_carto_serializer.rb | 6 +-- .../piece_justificative_serializer.rb | 4 +- app/serializers/procedure_serializer.rb | 13 +++-- app/serializers/type_de_champ_serializer.rb | 8 +-- .../type_de_piece_justificative_serializer.rb | 8 +-- ...preference_list_dossier_controller_spec.rb | 13 +++-- .../private_formulaires_controller_spec.rb | 11 ++-- spec/facades/dossiers_list_facades_spec.rb | 42 ++++++++-------- .../france_connect_particulier_spec.rb | 14 +++--- ...dossiers_list_gestionnaire_service_spec.rb | 12 ++--- .../accompagnateurs/show.html.haml_spec.rb | 24 ++++----- .../gestionnaires/index.html.haml_spec.rb | 12 ++--- .../previsualisations/show.html.haml_spec.rb | 3 +- .../dossiers/index_html.haml_spec.rb | 50 +++++++++---------- .../users/dossiers/index_html.haml_spec.rb | 6 +-- 39 files changed, 221 insertions(+), 220 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index e9db9c4fc..9a19249af 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -14,7 +14,8 @@ Layout/AlignHash: Enabled: false Layout/AlignParameters: - Enabled: false + Enabled: true + EnforcedStyle: with_fixed_indentation Layout/BlockEndNewline: Enabled: false diff --git a/app/controllers/admin/accompagnateurs_controller.rb b/app/controllers/admin/accompagnateurs_controller.rb index dcdb3ae46..6f6314851 100644 --- a/app/controllers/admin/accompagnateurs_controller.rb +++ b/app/controllers/admin/accompagnateurs_controller.rb @@ -7,17 +7,17 @@ class Admin::AccompagnateursController < AdminController def show assign_scope = @procedure.gestionnaires @accompagnateurs_assign = smart_listing_create :accompagnateurs_assign, - assign_scope, - partial: "admin/accompagnateurs/list_assign", - array: true + assign_scope, + partial: "admin/accompagnateurs/list_assign", + array: true not_assign_scope = current_administrateur.gestionnaires.where.not(id: assign_scope.ids) not_assign_scope = not_assign_scope.where("email LIKE '%#{params[:filter]}%'") if params[:filter] @accompagnateurs_not_assign = smart_listing_create :accompagnateurs_not_assign, - not_assign_scope, - partial: "admin/accompagnateurs/list_not_assign", - array: true + not_assign_scope, + partial: "admin/accompagnateurs/list_not_assign", + array: true @gestionnaire ||= Gestionnaire.new end diff --git a/app/controllers/admin/gestionnaires_controller.rb b/app/controllers/admin/gestionnaires_controller.rb index da082c5f3..e2e5aa343 100644 --- a/app/controllers/admin/gestionnaires_controller.rb +++ b/app/controllers/admin/gestionnaires_controller.rb @@ -4,9 +4,10 @@ class Admin::GestionnairesController < AdminController def index @gestionnaires = smart_listing_create :gestionnaires, - current_administrateur.gestionnaires, - partial: "admin/gestionnaires/list", - array: true + current_administrateur.gestionnaires, + partial: "admin/gestionnaires/list", + array: true + @gestionnaire ||= Gestionnaire.new end diff --git a/app/controllers/admin/procedures_controller.rb b/app/controllers/admin/procedures_controller.rb index 639c79242..3ca4c0fb9 100644 --- a/app/controllers/admin/procedures_controller.rb +++ b/app/controllers/admin/procedures_controller.rb @@ -6,18 +6,18 @@ class Admin::ProceduresController < AdminController def index @procedures = smart_listing_create :procedures, - current_administrateur.procedures.where(published: true, archived: false).order(created_at: :desc), - partial: "admin/procedures/list", - array: true + current_administrateur.procedures.where(published: true, archived: false).order(created_at: :desc), + partial: "admin/procedures/list", + array: true active_class end def archived @procedures = smart_listing_create :procedures, - current_administrateur.procedures.where(archived: true).order(created_at: :desc), - partial: "admin/procedures/list", - array: true + current_administrateur.procedures.where(archived: true).order(created_at: :desc), + partial: "admin/procedures/list", + array: true archived_class @@ -26,9 +26,9 @@ class Admin::ProceduresController < AdminController def draft @procedures = smart_listing_create :procedures, - current_administrateur.procedures.where(published: false, archived: false).order(created_at: :desc), - partial: "admin/procedures/list", - array: true + current_administrateur.procedures.where(published: false, archived: false).order(created_at: :desc), + partial: "admin/procedures/list", + array: true draft_class diff --git a/app/controllers/administrations_controller.rb b/app/controllers/administrations_controller.rb index e610ffcf5..26ebc9087 100644 --- a/app/controllers/administrations_controller.rb +++ b/app/controllers/administrations_controller.rb @@ -8,11 +8,9 @@ class AdministrationsController < ApplicationController @admin = Administrateur.new @admins = smart_listing_create :admins, - Administrateur.all.order(:email), - partial: "administrations/list", - array: true - - + Administrateur.all.order(:email), + partial: "administrations/list", + array: true end def create diff --git a/app/controllers/backoffice/dossiers_controller.rb b/app/controllers/backoffice/dossiers_controller.rb index 753b40302..7014e8c8d 100644 --- a/app/controllers/backoffice/dossiers_controller.rb +++ b/app/controllers/backoffice/dossiers_controller.rb @@ -79,17 +79,17 @@ class Backoffice::DossiersController < Backoffice::DossiersListController end smart_listing_create :search, - @dossiers, - partial: "backoffice/dossiers/list", - array: true, - default_sort: dossiers_list_facade.service.default_sort + @dossiers, + partial: "backoffice/dossiers/list", + array: true, + default_sort: dossiers_list_facade.service.default_sort rescue RuntimeError smart_listing_create :search, - [], - partial: "backoffice/dossiers/list", - array: true, - default_sort: dossiers_list_facade.service.default_sort + [], + partial: "backoffice/dossiers/list", + array: true, + default_sort: dossiers_list_facade.service.default_sort end def receive diff --git a/app/controllers/backoffice/dossiers_list_controller.rb b/app/controllers/backoffice/dossiers_list_controller.rb index 52274bb79..a61c0caf6 100644 --- a/app/controllers/backoffice/dossiers_list_controller.rb +++ b/app/controllers/backoffice/dossiers_list_controller.rb @@ -48,10 +48,10 @@ class Backoffice::DossiersListController < ApplicationController def default_smart_listing_create name, collection smart_listing_create name, - collection, - partial: 'backoffice/dossiers/list', - array: true, - default_sort: dossiers_list_facade.service.default_sort + collection, + partial: 'backoffice/dossiers/list', + array: true, + default_sort: dossiers_list_facade.service.default_sort end def param_smart_listing diff --git a/app/controllers/backoffice_controller.rb b/app/controllers/backoffice_controller.rb index 5f426be36..3188124c6 100644 --- a/app/controllers/backoffice_controller.rb +++ b/app/controllers/backoffice_controller.rb @@ -15,14 +15,14 @@ class BackofficeController < ApplicationController def invitations pending_avis = current_gestionnaire.avis.without_answer.includes(dossier: [:procedure]).by_latest @pending_avis = smart_listing_create :pending_avis, - pending_avis, - partial: 'backoffice/dossiers/list_invitations', - array: true + pending_avis, + partial: 'backoffice/dossiers/list_invitations', + array: true avis_with_answer = current_gestionnaire.avis.with_answer.includes(dossier: [:procedure]).by_latest @avis_with_answer = smart_listing_create :avis_with_answer, - avis_with_answer, - partial: 'backoffice/dossiers/list_invitations', - array: true + avis_with_answer, + partial: 'backoffice/dossiers/list_invitations', + array: true end end diff --git a/app/controllers/commentaires_controller.rb b/app/controllers/commentaires_controller.rb index b22ada7eb..7a4dcc8db 100644 --- a/app/controllers/commentaires_controller.rb +++ b/app/controllers/commentaires_controller.rb @@ -1,9 +1,9 @@ class CommentairesController < ApplicationController def index @facade = DossierFacades.new( - params[:dossier_id], - (current_gestionnaire || current_user).email, - params[:champs_id] + params[:dossier_id], + (current_gestionnaire || current_user).email, + params[:champs_id] ) render layout: false rescue ActiveRecord::RecordNotFound diff --git a/app/controllers/demo_controller.rb b/app/controllers/demo_controller.rb index 5933c5735..54f45464d 100644 --- a/app/controllers/demo_controller.rb +++ b/app/controllers/demo_controller.rb @@ -6,8 +6,8 @@ class DemoController < ApplicationController return redirect_to root_path if Rails.env.production? smart_listing_create :procedures, - Procedure.where(archived: false, published: true).order("id DESC"), - partial: "demo/list", - array: true + Procedure.where(archived: false, published: true).order("id DESC"), + partial: "demo/list", + array: true end end diff --git a/app/controllers/users/dossiers_controller.rb b/app/controllers/users/dossiers_controller.rb index 1d9964d72..8decc82ca 100644 --- a/app/controllers/users/dossiers_controller.rb +++ b/app/controllers/users/dossiers_controller.rb @@ -30,9 +30,9 @@ class Users::DossiersController < UsersController end @dossiers = smart_listing_create :dossiers, - @dossiers_filtered, - partial: "users/dossiers/list", - array: true + @dossiers_filtered, + partial: "users/dossiers/list", + array: true end def commencer diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 67c94e85f..3f013040e 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -17,8 +17,8 @@ class UsersController < ApplicationController def authorized_routes? controller redirect_to_root_path 'Le status de votre dossier n\'autorise pas cette URL' unless UserRoutesAuthorizationService.authorized_route?( - controller, - current_user_dossier) + controller, + current_user_dossier) rescue ActiveRecord::RecordNotFound redirect_to_root_path 'Vous n’avez pas accès à ce dossier.' end diff --git a/app/lib/carto/sgmap/api.rb b/app/lib/carto/sgmap/api.rb index db29d7d0b..ef72fc062 100644 --- a/app/lib/carto/sgmap/api.rb +++ b/app/lib/carto/sgmap/api.rb @@ -18,8 +18,8 @@ class CARTO::SGMAP::API verify_ssl_mode = OpenSSL::SSL::VERIFY_NONE RestClient::Resource.new( - url, - verify_ssl: verify_ssl_mode, + url, + verify_ssl: verify_ssl_mode, ).post params[:geojson], content_type: 'application/json' rescue RestClient::InternalServerError diff --git a/app/models/administrateur.rb b/app/models/administrateur.rb index 731e5df5c..072fd8c9d 100644 --- a/app/models/administrateur.rb +++ b/app/models/administrateur.rb @@ -1,6 +1,6 @@ class Administrateur < ActiveRecord::Base devise :database_authenticatable, :registerable, - :recoverable, :rememberable, :trackable, :validatable + :recoverable, :rememberable, :trackable, :validatable has_and_belongs_to_many :gestionnaires has_many :procedures diff --git a/app/models/gestionnaire.rb b/app/models/gestionnaire.rb index 6492cca64..190b9502c 100644 --- a/app/models/gestionnaire.rb +++ b/app/models/gestionnaire.rb @@ -1,6 +1,6 @@ class Gestionnaire < ActiveRecord::Base devise :database_authenticatable, :registerable, - :recoverable, :rememberable, :trackable, :validatable + :recoverable, :rememberable, :trackable, :validatable has_and_belongs_to_many :administrateurs diff --git a/app/models/piece_justificative.rb b/app/models/piece_justificative.rb index c9537adf0..6b08703b4 100644 --- a/app/models/piece_justificative.rb +++ b/app/models/piece_justificative.rb @@ -33,7 +33,7 @@ class PieceJustificative < ActiveRecord::Base (RemoteDownloader.new content.filename).url else (LocalDownloader.new content.path, - (type_de_piece_justificative.nil? ? content.original_filename : type_de_piece_justificative.libelle)).url + (type_de_piece_justificative.nil? ? content.original_filename : type_de_piece_justificative.libelle)).url end end end diff --git a/app/models/user.rb b/app/models/user.rb index c4dab2a5f..3189c652d 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -7,7 +7,7 @@ class User < ActiveRecord::Base # Include default devise modules. Others available are: # :confirmable, :lockable, :timeoutable and :omniauthable devise :database_authenticatable, :registerable, - :recoverable, :rememberable, :trackable, :validatable + :recoverable, :rememberable, :trackable, :validatable has_many :dossiers, dependent: :destroy has_many :invites, dependent: :destroy diff --git a/app/serializers/cerfa_serializer.rb b/app/serializers/cerfa_serializer.rb index a5b832936..1971db96a 100644 --- a/app/serializers/cerfa_serializer.rb +++ b/app/serializers/cerfa_serializer.rb @@ -1,6 +1,6 @@ class CerfaSerializer < ActiveModel::Serializer attributes :created_at, - :content_url + :content_url has_one :user end diff --git a/app/serializers/commentaire_serializer.rb b/app/serializers/commentaire_serializer.rb index 587cde833..c7366b65b 100644 --- a/app/serializers/commentaire_serializer.rb +++ b/app/serializers/commentaire_serializer.rb @@ -1,5 +1,5 @@ class CommentaireSerializer < ActiveModel::Serializer attributes :email, - :body, - :created_at + :body, + :created_at end diff --git a/app/serializers/dossier_serializer.rb b/app/serializers/dossier_serializer.rb index 73b7dcc8c..c731d452b 100644 --- a/app/serializers/dossier_serializer.rb +++ b/app/serializers/dossier_serializer.rb @@ -1,16 +1,16 @@ class DossierSerializer < ActiveModel::Serializer attributes :id, - :created_at, - :updated_at, - :archived, - :mandataire_social, - :state, - :simplified_state, - :initiated_at, - :received_at, - :processed_at, - :accompagnateurs, - :invites + :created_at, + :updated_at, + :archived, + :mandataire_social, + :state, + :simplified_state, + :initiated_at, + :received_at, + :processed_at, + :accompagnateurs, + :invites has_one :entreprise has_one :etablissement diff --git a/app/serializers/dossier_table_export_serializer.rb b/app/serializers/dossier_table_export_serializer.rb index 3bd4ba52a..84e569787 100644 --- a/app/serializers/dossier_table_export_serializer.rb +++ b/app/serializers/dossier_table_export_serializer.rb @@ -1,20 +1,20 @@ class DossierTableExportSerializer < ActiveModel::Serializer attributes :id, - :created_at, - :updated_at, - :archived, - :mandataire_social, - :state, - :initiated_at, - :received_at, - :processed_at + :created_at, + :updated_at, + :archived, + :mandataire_social, + :state, + :initiated_at, + :received_at, + :processed_at attribute :emails_accompagnateurs attributes :individual_gender, - :individual_prenom, - :individual_nom, - :individual_birthdate + :individual_prenom, + :individual_nom, + :individual_birthdate def individual_prenom object.individual.try(:prenom) diff --git a/app/serializers/dossiers_serializer.rb b/app/serializers/dossiers_serializer.rb index e2b53b679..e43f4b63d 100644 --- a/app/serializers/dossiers_serializer.rb +++ b/app/serializers/dossiers_serializer.rb @@ -1,4 +1,4 @@ class DossiersSerializer < ActiveModel::Serializer attributes :id, - :updated_at + :updated_at end diff --git a/app/serializers/entreprise_serializer.rb b/app/serializers/entreprise_serializer.rb index b293b3142..d46ab8672 100644 --- a/app/serializers/entreprise_serializer.rb +++ b/app/serializers/entreprise_serializer.rb @@ -1,14 +1,14 @@ class EntrepriseSerializer < ActiveModel::Serializer attributes :siren, - :capital_social, - :numero_tva_intracommunautaire, - :forme_juridique, - :forme_juridique_code, - :nom_commercial, - :raison_sociale, - :siret_siege_social, - :code_effectif_entreprise, - :date_creation, - :nom, - :prenom + :capital_social, + :numero_tva_intracommunautaire, + :forme_juridique, + :forme_juridique_code, + :nom_commercial, + :raison_sociale, + :siret_siege_social, + :code_effectif_entreprise, + :date_creation, + :nom, + :prenom end diff --git a/app/serializers/etablissement_serializer.rb b/app/serializers/etablissement_serializer.rb index 11b4ce969..6cd091859 100644 --- a/app/serializers/etablissement_serializer.rb +++ b/app/serializers/etablissement_serializer.rb @@ -1,15 +1,14 @@ class EtablissementSerializer < ActiveModel::Serializer attributes :siret, - :siege_social, - :naf, - :libelle_naf, - :adresse, - :numero_voie, - :type_voie, - :nom_voie, - :complement_adresse, - :code_postal, - :localite, - :code_insee_localite - + :siege_social, + :naf, + :libelle_naf, + :adresse, + :numero_voie, + :type_voie, + :nom_voie, + :complement_adresse, + :code_postal, + :localite, + :code_insee_localite end diff --git a/app/serializers/module_api_carto_serializer.rb b/app/serializers/module_api_carto_serializer.rb index 671b754bf..0c993848d 100644 --- a/app/serializers/module_api_carto_serializer.rb +++ b/app/serializers/module_api_carto_serializer.rb @@ -1,7 +1,5 @@ class ModuleApiCartoSerializer < ActiveModel::Serializer attributes :use_api_carto, - :quartiers_prioritaires, - :cadastre - - + :quartiers_prioritaires, + :cadastre end diff --git a/app/serializers/piece_justificative_serializer.rb b/app/serializers/piece_justificative_serializer.rb index 1b460e320..fdcf1d2c9 100644 --- a/app/serializers/piece_justificative_serializer.rb +++ b/app/serializers/piece_justificative_serializer.rb @@ -1,7 +1,7 @@ class PieceJustificativeSerializer < ActiveModel::Serializer attributes :created_at, - :type_de_piece_justificative_id, - :content_url + :type_de_piece_justificative_id, + :content_url has_one :user end diff --git a/app/serializers/procedure_serializer.rb b/app/serializers/procedure_serializer.rb index c85ed7ff4..228a1f710 100644 --- a/app/serializers/procedure_serializer.rb +++ b/app/serializers/procedure_serializer.rb @@ -3,13 +3,12 @@ class ProcedureSerializer < ActiveModel::Serializer attribute :lien_demarche, key: :link attributes :id, - :description, - :organisation, - :direction, - :archived, - :geographic_information, - :total_dossier - + :description, + :organisation, + :direction, + :archived, + :geographic_information, + :total_dossier has_one :geographic_information, serializer: ModuleApiCartoSerializer has_many :types_de_champ, serializer: TypeDeChampSerializer diff --git a/app/serializers/type_de_champ_serializer.rb b/app/serializers/type_de_champ_serializer.rb index bec424797..152e908e1 100644 --- a/app/serializers/type_de_champ_serializer.rb +++ b/app/serializers/type_de_champ_serializer.rb @@ -1,7 +1,7 @@ class TypeDeChampSerializer < ActiveModel::Serializer attributes :id, - :libelle, - :type_champ, - :order_place, - :description + :libelle, + :type_champ, + :order_place, + :description end diff --git a/app/serializers/type_de_piece_justificative_serializer.rb b/app/serializers/type_de_piece_justificative_serializer.rb index cff798508..53ee7cf81 100644 --- a/app/serializers/type_de_piece_justificative_serializer.rb +++ b/app/serializers/type_de_piece_justificative_serializer.rb @@ -1,7 +1,7 @@ class TypeDePieceJustificativeSerializer < ActiveModel::Serializer attributes :id, - :libelle, - :description, - :order_place, - :lien_demarche + :libelle, + :description, + :order_place, + :lien_demarche end diff --git a/spec/controllers/backoffice/preference_list_dossier_controller_spec.rb b/spec/controllers/backoffice/preference_list_dossier_controller_spec.rb index ec365de42..cd6ca6ad7 100644 --- a/spec/controllers/backoffice/preference_list_dossier_controller_spec.rb +++ b/spec/controllers/backoffice/preference_list_dossier_controller_spec.rb @@ -14,11 +14,14 @@ describe Backoffice::PreferenceListDossierController, type: :controller do describe '#POST add' do subject { post :add, - params: {libelle: libelle, - table: table, - attr: attr, - attr_decorate: attr_decorate, - bootstrap_lg: bootstrap_lg} } + params: { + libelle: libelle, + table: table, + attr: attr, + attr_decorate: attr_decorate, + bootstrap_lg: bootstrap_lg + } + } it { expect(subject.status).to eq 200 } it { expect { subject }.to change(PreferenceListDossier, :count).by(1) } diff --git a/spec/controllers/backoffice/private_formulaires_controller_spec.rb b/spec/controllers/backoffice/private_formulaires_controller_spec.rb index 2ff55d3bd..65e44d8ec 100644 --- a/spec/controllers/backoffice/private_formulaires_controller_spec.rb +++ b/spec/controllers/backoffice/private_formulaires_controller_spec.rb @@ -13,10 +13,13 @@ describe Backoffice::PrivateFormulairesController, type: :controller do describe '#PATCH update' do subject { patch :update, - params: {dossier_id: dossier.id, - champs: { - "'#{dossier.champs_private.first.id}'" => dossier_champs_first - }} } + params: { + dossier_id: dossier.id, + champs: { + "'#{dossier.champs_private.first.id}'" => dossier_champs_first + } + } + } before do subject diff --git a/spec/facades/dossiers_list_facades_spec.rb b/spec/facades/dossiers_list_facades_spec.rb index 8713df086..f8ed7e2fa 100644 --- a/spec/facades/dossiers_list_facades_spec.rb +++ b/spec/facades/dossiers_list_facades_spec.rb @@ -7,17 +7,17 @@ describe DossiersListFacades do let(:procedure_2) { create :procedure, libelle: 'Ma seconde procédure' } let!(:preference) { create :preference_list_dossier, - gestionnaire: gestionnaire, - table: nil, - attr: 'state', - attr_decorate: 'display_state' } + gestionnaire: gestionnaire, + table: nil, + attr: 'state', + attr_decorate: 'display_state' } let!(:preference_2) { create :preference_list_dossier, - gestionnaire: gestionnaire, - table: 'champs', - attr: 'state', - attr_decorate: 'display_state', - procedure_id: procedure.id } + gestionnaire: gestionnaire, + table: 'champs', + attr: 'state', + attr_decorate: 'display_state', + procedure_id: procedure.id } before do create :assign_to, procedure: procedure, gestionnaire: gestionnaire @@ -58,12 +58,12 @@ describe DossiersListFacades do let(:facade) { described_class.new gestionnaire, 'nouveaux', procedure_2 } let!(:preference) { create :preference_list_dossier, - gestionnaire: gestionnaire, - table: table, - attr: 'state', - attr_decorate: 'display_state', - filter: filter, - procedure_id: procedure_id } + gestionnaire: gestionnaire, + table: table, + attr: 'state', + attr_decorate: 'display_state', + filter: filter, + procedure_id: procedure_id } subject { facade.active_filter? preference } @@ -99,12 +99,12 @@ describe DossiersListFacades do before do create :preference_list_dossier, - gestionnaire: gestionnaire, - table: 'champs', - attr: 'state', - attr_decorate: 'display_state', - filter: 'plop', - procedure_id: procedure_id + gestionnaire: gestionnaire, + table: 'champs', + attr: 'state', + attr_decorate: 'display_state', + filter: 'plop', + procedure_id: procedure_id end it { is_expected.to be_falsey } diff --git a/spec/features/france_connect/france_connect_particulier_spec.rb b/spec/features/france_connect/france_connect_particulier_spec.rb index 1ed8ca15f..2ba15e71b 100644 --- a/spec/features/france_connect/france_connect_particulier_spec.rb +++ b/spec/features/france_connect/france_connect_particulier_spec.rb @@ -34,13 +34,13 @@ feature 'France Connect Particulier Connexion' do context 'when authentification is ok' do let(:france_connect_information) { create(:france_connect_information, - france_connect_particulier_id: france_connect_particulier_id, - given_name: given_name, - family_name: family_name, - birthdate: birthdate, - birthplace: birthplace, - gender: gender, - email_france_connect: email) } + france_connect_particulier_id: france_connect_particulier_id, + given_name: given_name, + family_name: family_name, + birthdate: birthdate, + birthplace: birthplace, + gender: gender, + email_france_connect: email) } before do allow_any_instance_of(FranceConnectParticulierClient).to receive(:authorization_uri).and_return(france_connect_particulier_callback_path(code: code)) diff --git a/spec/services/dossiers_list_gestionnaire_service_spec.rb b/spec/services/dossiers_list_gestionnaire_service_spec.rb index d45293868..f1ca2b6e2 100644 --- a/spec/services/dossiers_list_gestionnaire_service_spec.rb +++ b/spec/services/dossiers_list_gestionnaire_service_spec.rb @@ -231,12 +231,12 @@ describe DossiersListGestionnaireService do context 'when preference list contain a champ' do before do create :preference_list_dossier, - gestionnaire: gestionnaire, - table: 'champs', - attr: '34', - attr_decorate: '', - filter: 'plop', - procedure_id: create(:procedure) + gestionnaire: gestionnaire, + table: 'champs', + attr: '34', + attr_decorate: '', + filter: 'plop', + procedure_id: create(:procedure) end it { is_expected.to eq "CAST(dossiers.id as TEXT) LIKE '%23%' AND CAST(entreprises.raison_sociale as TEXT) LIKE '%plop%' AND champs.type_de_champ_id = 34 AND CAST(champs.value as TEXT) LIKE '%plop%'" } diff --git a/spec/views/admin/accompagnateurs/show.html.haml_spec.rb b/spec/views/admin/accompagnateurs/show.html.haml_spec.rb index 4593795ec..231b6f05a 100644 --- a/spec/views/admin/accompagnateurs/show.html.haml_spec.rb +++ b/spec/views/admin/accompagnateurs/show.html.haml_spec.rb @@ -12,14 +12,14 @@ describe 'admin/accompagnateurs/show.html.haml', type: :view do assign(:gestionnaire, Gestionnaire.new) assign(:accompagnateurs_assign, (smart_listing_create :accompagnateurs_assign, - assign_gestionnaires, - partial: "admin/accompagnateurs/list_assign", - array: true)) + assign_gestionnaires, + partial: "admin/accompagnateurs/list_assign", + array: true)) assign(:accompagnateurs_not_assign, (smart_listing_create :accompagnateurs_not_assign, - not_assign_gestionnaires, - partial: "admin/accompagnateurs/list_not_assign", - array: true)) + not_assign_gestionnaires, + partial: "admin/accompagnateurs/list_not_assign", + array: true)) end context 'when admin have none accompagnateur ' do @@ -43,14 +43,14 @@ describe 'admin/accompagnateurs/show.html.haml', type: :view do assign_gestionnaires.reload assign(:accompagnateurs_assign, (smart_listing_create :accompagnateurs_assign, - assign_gestionnaires, - partial: "admin/accompagnateurs/list_assign", - array: true)) + assign_gestionnaires, + partial: "admin/accompagnateurs/list_assign", + array: true)) assign(:accompagnateurs_not_assign, (smart_listing_create :accompagnateurs_not_assign, - not_assign_gestionnaires, - partial: "admin/accompagnateurs/list_not_assign", - array: true)) + not_assign_gestionnaires, + partial: "admin/accompagnateurs/list_not_assign", + array: true)) render end diff --git a/spec/views/admin/gestionnaires/index.html.haml_spec.rb b/spec/views/admin/gestionnaires/index.html.haml_spec.rb index 7f8820abd..be3014619 100644 --- a/spec/views/admin/gestionnaires/index.html.haml_spec.rb +++ b/spec/views/admin/gestionnaires/index.html.haml_spec.rb @@ -6,9 +6,9 @@ describe 'admin/gestionnaires/index.html.haml', type: :view do before do assign(:gestionnaires, (smart_listing_create :gestionnaires, - admin.gestionnaires, - partial: "admin/gestionnaires/list", - array: true)) + admin.gestionnaires, + partial: "admin/gestionnaires/list", + array: true)) assign(:gestionnaire, Gestionnaire.new()) end @@ -24,9 +24,9 @@ describe 'admin/gestionnaires/index.html.haml', type: :view do create(:gestionnaire, administrateurs: [admin]) admin.reload assign(:gestionnaires, (smart_listing_create :gestionnaires, - admin.gestionnaires, - partial: "admin/gestionnaires/list", - array: true)) + admin.gestionnaires, + partial: "admin/gestionnaires/list", + array: true)) render end it { expect(rendered).to match(/gest\d+@gest.com/) } diff --git a/spec/views/admin/previsualisations/show.html.haml_spec.rb b/spec/views/admin/previsualisations/show.html.haml_spec.rb index cfed1dd02..ffca23efe 100644 --- a/spec/views/admin/previsualisations/show.html.haml_spec.rb +++ b/spec/views/admin/previsualisations/show.html.haml_spec.rb @@ -65,8 +65,7 @@ describe 'admin/previsualisations/show.html.haml', type: :view do context 'les valeurs sont réaffichées si elles sont présentes dans la BDD' do let!(:dossier) do - create(:dossier, - user: user) + create(:dossier, user: user) end before do diff --git a/spec/views/backoffice/dossiers/index_html.haml_spec.rb b/spec/views/backoffice/dossiers/index_html.haml_spec.rb index 4951907d1..307fa0113 100644 --- a/spec/views/backoffice/dossiers/index_html.haml_spec.rb +++ b/spec/views/backoffice/dossiers/index_html.haml_spec.rb @@ -29,28 +29,28 @@ describe 'backoffice/dossiers/index.html.haml', type: :view do decorate_dossier_without_continuation.entreprise.update_column(:raison_sociale, 'plnp') create :preference_list_dossier, - gestionnaire: gestionnaire, - table: nil, - attr: 'state', - attr_decorate: 'display_state' + gestionnaire: gestionnaire, + table: nil, + attr: 'state', + attr_decorate: 'display_state' create :preference_list_dossier, - gestionnaire: gestionnaire, - table: 'procedure', - attr: 'libelle', - attr_decorate: 'libelle' + gestionnaire: gestionnaire, + table: 'procedure', + attr: 'libelle', + attr_decorate: 'libelle' create :preference_list_dossier, - gestionnaire: gestionnaire, - table: 'entreprise', - attr: 'raison_sociale', - attr_decorate: 'raison_sociale' + gestionnaire: gestionnaire, + table: 'entreprise', + attr: 'raison_sociale', + attr_decorate: 'raison_sociale' create :preference_list_dossier, - gestionnaire: gestionnaire, - table: nil, - attr: 'last_update', - attr_decorate: 'last_update' + gestionnaire: gestionnaire, + table: nil, + attr: 'last_update', + attr_decorate: 'last_update' create :assign_to, gestionnaire: gestionnaire, procedure: procedure sign_in gestionnaire @@ -58,19 +58,19 @@ describe 'backoffice/dossiers/index.html.haml', type: :view do assign :facade_data_view, dossiers_list_facade assign(:new_dossiers, (smart_listing_create :new_dossiers, - new_dossiers_list, - partial: "backoffice/dossiers/list", - array: true)) + new_dossiers_list, + partial: "backoffice/dossiers/list", + array: true)) assign(:follow_dossiers, (smart_listing_create :follow_dossiers, - follow_dossiers_list, - partial: "backoffice/dossiers/list", - array: true)) + follow_dossiers_list, + partial: "backoffice/dossiers/list", + array: true)) assign(:all_state_dossiers, (smart_listing_create :all_state_dossiers, - all_state_dossiers_list, - partial: "backoffice/dossiers/list", - array: true)) + all_state_dossiers_list, + partial: "backoffice/dossiers/list", + array: true)) render end diff --git a/spec/views/users/dossiers/index_html.haml_spec.rb b/spec/views/users/dossiers/index_html.haml_spec.rb index 3813456f8..dc6721b41 100644 --- a/spec/views/users/dossiers/index_html.haml_spec.rb +++ b/spec/views/users/dossiers/index_html.haml_spec.rb @@ -22,9 +22,9 @@ describe 'users/dossiers/index.html.haml', type: :view do assign :dossiers_list_facade, (DossiersListFacades.new user, liste) assign(:dossiers, (smart_listing_create :dossiers, - dossiers_to_display, - partial: "users/dossiers/list", - array: true)) + dossiers_to_display, + partial: "users/dossiers/list", + array: true)) render end