From 633b55aca0b30d2b89efb38caf29b446cd2827ce Mon Sep 17 00:00:00 2001 From: Simon Lehericey Date: Thu, 21 Sep 2017 17:12:21 +0200 Subject: [PATCH] [Fix #503] Dossier: remove replied --- .../backoffice/dossiers_controller.rb | 2 +- app/controllers/users/carte_controller.rb | 2 +- .../users/description_controller.rb | 2 +- .../users/recapitulatif_controller.rb | 2 +- app/models/dossier.rb | 15 ++----- app/views/dossiers/_dossier_show.html.haml | 2 +- config/locales/models/dossier/fr.yml | 1 - .../commentaires_controller_spec.rb | 4 +- .../backoffice/dossiers_controller_spec.rb | 4 +- spec/controllers/invites_controller_spec.rb | 2 +- .../new_gestionnaire/avis_controller_spec.rb | 2 +- .../dossiers_controller_spec.rb | 8 ++-- .../procedures_controller_spec.rb | 2 +- .../recherches_controller_spec.rb | 6 +-- .../users/commentaires_controller_spec.rb | 18 -------- .../dossiers/commentaires_controller_spec.rb | 2 - spec/decorators/dossier_decorator_spec.rb | 5 --- .../admin_procedures_show_facades_spec.rb | 2 +- spec/factories/dossier.rb | 4 +- .../users/flux_de_commentaires_spec.rb | 2 +- spec/features/users/list_dossiers_spec.rb | 6 +-- spec/features/users/onglets_link_spec.rb | 3 +- spec/models/dossier_spec.rb | 42 +------------------ spec/models/procedure_spec.rb | 2 +- ...dossiers_list_gestionnaire_service_spec.rb | 3 -- .../user_routes_authorization_service_spec.rb | 25 ----------- .../dossiers/index_html.haml_spec.rb | 5 +-- ...backoffice_dossierscontroller_show_spec.rb | 12 ------ ...users_recapitulatifcontroller_show_spec.rb | 10 ----- .../dossiers/show.html.haml_spec.rb | 2 +- .../users/dossiers/index_html.haml_spec.rb | 7 +--- .../auto_archive_procedure_worker_spec.rb | 2 +- 32 files changed, 37 insertions(+), 169 deletions(-) diff --git a/app/controllers/backoffice/dossiers_controller.rb b/app/controllers/backoffice/dossiers_controller.rb index e25fc8275..4a9412636 100644 --- a/app/controllers/backoffice/dossiers_controller.rb +++ b/app/controllers/backoffice/dossiers_controller.rb @@ -179,7 +179,7 @@ class Backoffice::DossiersController < Backoffice::DossiersListController def reopen create_dossier_facade params[:dossier_id] - @facade.dossier.replied! + @facade.dossier.initiated! flash.notice = 'Dossier repassé en construction.' redirect_to_dossier(@facade.dossier) diff --git a/app/controllers/users/carte_controller.rb b/app/controllers/users/carte_controller.rb index 3c10c7df9..f561bad88 100644 --- a/app/controllers/users/carte_controller.rb +++ b/app/controllers/users/carte_controller.rb @@ -56,7 +56,7 @@ class Users::CarteController < UsersController def self.route_authorization { - states: [:draft, :initiated, :replied, :updated], + states: [:draft, :initiated, :updated], api_carto: true } end diff --git a/app/controllers/users/description_controller.rb b/app/controllers/users/description_controller.rb index 0771c13ea..d27627c53 100644 --- a/app/controllers/users/description_controller.rb +++ b/app/controllers/users/description_controller.rb @@ -93,7 +93,7 @@ class Users::DescriptionController < UsersController def self.route_authorization { - states: [:draft, :initiated, :replied, :updated] + states: [:draft, :initiated, :updated] } end diff --git a/app/controllers/users/recapitulatif_controller.rb b/app/controllers/users/recapitulatif_controller.rb index 88dd4d2f8..3405b899d 100644 --- a/app/controllers/users/recapitulatif_controller.rb +++ b/app/controllers/users/recapitulatif_controller.rb @@ -18,7 +18,7 @@ class Users::RecapitulatifController < UsersController def self.route_authorization { - states: [:initiated, :replied, :updated, :received, :without_continuation, :closed, :refused] + states: [:initiated, :updated, :received, :without_continuation, :closed, :refused] } end diff --git a/app/models/dossier.rb b/app/models/dossier.rb index 1f59bd56f..dc0e2c884 100644 --- a/app/models/dossier.rb +++ b/app/models/dossier.rb @@ -2,7 +2,6 @@ class Dossier < ActiveRecord::Base enum state: { draft: 'draft', initiated: 'initiated', - replied: 'replied', # action utilisateur demandé updated: 'updated', # etude par l'administration en cours received: 'received', closed: 'closed', @@ -12,7 +11,7 @@ class Dossier < ActiveRecord::Base BROUILLON = %w(draft) NOUVEAUX = %w(initiated) - EN_CONSTRUCTION = %w(initiated updated replied) + EN_CONSTRUCTION = %w(initiated updated) EN_INSTRUCTION = %w(received) EN_CONSTRUCTION_OU_INSTRUCTION = EN_CONSTRUCTION + EN_INSTRUCTION A_INSTRUIRE = %w(received) @@ -161,22 +160,14 @@ class Dossier < ActiveRecord::Base if draft? initiated! end - when 'update' - if replied? - updated! - end - when 'comment' - if replied? - updated! - end end when 'gestionnaire' case action when 'comment' if updated? - replied! + initiated! elsif initiated? - replied! + initiated! end when 'follow' if initiated? diff --git a/app/views/dossiers/_dossier_show.html.haml b/app/views/dossiers/_dossier_show.html.haml index afb5a5c77..7c733d9fb 100644 --- a/app/views/dossiers/_dossier_show.html.haml +++ b/app/views/dossiers/_dossier_show.html.haml @@ -13,7 +13,7 @@ .col-xs-8.title-no-expanse .carret-right INFORMATIONS DU DEMANDEUR - - if !@current_gestionnaire && ["draft", "updated", "replied", "initiated"].include?(@facade.dossier.state) + - if !@current_gestionnaire && ["draft", "updated", "initiated"].include?(@facade.dossier.state) %a#add_siret.action{ href: users_dossier_add_siret_path(dossier_id: @facade.dossier.id) } .col-lg-4.col-md-4.col-sm-4.col-xs-4.action Renseigner un SIRET diff --git a/config/locales/models/dossier/fr.yml b/config/locales/models/dossier/fr.yml index 562adc110..67ab08e55 100644 --- a/config/locales/models/dossier/fr.yml +++ b/config/locales/models/dossier/fr.yml @@ -10,7 +10,6 @@ fr: state: draft: "Brouillon" initiated: "En construction" - replied: "En construction" updated: "En construction" received: "En instruction" closed: "Accepté" diff --git a/spec/controllers/backoffice/commentaires_controller_spec.rb b/spec/controllers/backoffice/commentaires_controller_spec.rb index a491df621..c3c2ea20b 100644 --- a/spec/controllers/backoffice/commentaires_controller_spec.rb +++ b/spec/controllers/backoffice/commentaires_controller_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe Backoffice::CommentairesController, type: :controller do - let(:dossier) { create(:dossier, :replied) } + let(:dossier) { create(:dossier, :initiated) } let(:dossier_id) { dossier.id } let(:email_commentaire) { 'test@test.com' } let(:texte_commentaire) { 'Commentaire de test' } @@ -124,7 +124,7 @@ describe Backoffice::CommentairesController, type: :controller do subject { dossier.state } - it { is_expected.to eq('replied') } + it { is_expected.to eq('initiated') } it 'Notification email is send' do expect(NotificationMailer).to receive(:new_answer).and_return(NotificationMailer) diff --git a/spec/controllers/backoffice/dossiers_controller_spec.rb b/spec/controllers/backoffice/dossiers_controller_spec.rb index befeac817..d5837a5ae 100644 --- a/spec/controllers/backoffice/dossiers_controller_spec.rb +++ b/spec/controllers/backoffice/dossiers_controller_spec.rb @@ -360,11 +360,11 @@ describe Backoffice::DossiersController, type: :controller do subject { post :reopen, params: {dossier_id: dossier_id} } - it 'change state to replied' do + it 'change state to initiated' do subject dossier.reload - expect(dossier.state).to eq('replied') + expect(dossier.state).to eq('initiated') end it { is_expected.to redirect_to backoffice_dossier_path(id: dossier_id) } diff --git a/spec/controllers/invites_controller_spec.rb b/spec/controllers/invites_controller_spec.rb index 952e10e42..c2c0441b9 100644 --- a/spec/controllers/invites_controller_spec.rb +++ b/spec/controllers/invites_controller_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe InvitesController, type: :controller do - let(:dossier) { create(:dossier, :replied) } + let(:dossier) { create(:dossier, :initiated) } let(:email) { 'plop@octo.com' } describe '#POST create' do diff --git a/spec/controllers/new_gestionnaire/avis_controller_spec.rb b/spec/controllers/new_gestionnaire/avis_controller_spec.rb index 5254c3344..1a8b27a6a 100644 --- a/spec/controllers/new_gestionnaire/avis_controller_spec.rb +++ b/spec/controllers/new_gestionnaire/avis_controller_spec.rb @@ -6,7 +6,7 @@ describe NewGestionnaire::AvisController, type: :controller do let(:claimant) { create(:gestionnaire) } let(:gestionnaire) { create(:gestionnaire) } let(:procedure) { create(:procedure, :published, gestionnaires: [gestionnaire]) } - let(:dossier) { create(:dossier, :replied, procedure: procedure) } + let(:dossier) { create(:dossier, :initiated, procedure: procedure) } let!(:avis_without_answer) { Avis.create(dossier: dossier, claimant: claimant, gestionnaire: gestionnaire) } let!(:avis_with_answer) { Avis.create(dossier: dossier, claimant: claimant, gestionnaire: gestionnaire, answer: 'yop') } diff --git a/spec/controllers/new_gestionnaire/dossiers_controller_spec.rb b/spec/controllers/new_gestionnaire/dossiers_controller_spec.rb index 988e8e05a..0ddb3f10a 100644 --- a/spec/controllers/new_gestionnaire/dossiers_controller_spec.rb +++ b/spec/controllers/new_gestionnaire/dossiers_controller_spec.rb @@ -5,16 +5,16 @@ describe NewGestionnaire::DossiersController, type: :controller do let(:gestionnaire) { create(:gestionnaire) } let(:procedure) { create(:procedure, :published, gestionnaires: [gestionnaire]) } - let(:dossier) { create(:dossier, :replied, procedure: procedure) } + let(:dossier) { create(:dossier, :initiated, procedure: procedure) } before { sign_in(gestionnaire) } describe '#attestation' do context 'when a dossier has an attestation' do let(:fake_pdf) { double(read: 'pdf content') } - let!(:dossier) { create(:dossier, :replied, attestation: Attestation.new, procedure: procedure) } + let!(:dossier) { create(:dossier, :initiated, attestation: Attestation.new, procedure: procedure) } let!(:procedure) { create(:procedure, :published, gestionnaires: [gestionnaire]) } - let!(:dossier) { create(:dossier, :replied, attestation: Attestation.new, procedure: procedure) } + let!(:dossier) { create(:dossier, :initiated, attestation: Attestation.new, procedure: procedure) } it 'returns the attestation pdf' do allow_any_instance_of(Attestation).to receive(:pdf).and_return(fake_pdf) @@ -148,7 +148,7 @@ describe NewGestionnaire::DossiersController, type: :controller do end let(:dossier) do - create(:dossier, :replied, procedure: procedure, champs_private: [champ_multiple_drop_down_list, champ_datetime]) + create(:dossier, :initiated, procedure: procedure, champs_private: [champ_multiple_drop_down_list, champ_datetime]) end before do diff --git a/spec/controllers/new_gestionnaire/procedures_controller_spec.rb b/spec/controllers/new_gestionnaire/procedures_controller_spec.rb index 30f70803a..254260cf7 100644 --- a/spec/controllers/new_gestionnaire/procedures_controller_spec.rb +++ b/spec/controllers/new_gestionnaire/procedures_controller_spec.rb @@ -137,7 +137,7 @@ describe NewGestionnaire::ProceduresController, type: :controller do let(:state) { "initiated" } before do - create(:dossier, procedure: procedure, state: "replied") + create(:dossier, procedure: procedure, state: "initiated") create(:dossier, procedure: procedure, state: "received") create(:dossier, procedure: procedure, state: "without_continuation", archived: true) diff --git a/spec/controllers/new_gestionnaire/recherches_controller_spec.rb b/spec/controllers/new_gestionnaire/recherches_controller_spec.rb index f7147c73d..06a3f557a 100644 --- a/spec/controllers/new_gestionnaire/recherches_controller_spec.rb +++ b/spec/controllers/new_gestionnaire/recherches_controller_spec.rb @@ -1,8 +1,8 @@ require 'spec_helper' describe NewGestionnaire::RecherchesController, type: :controller do - let(:dossier) { create(:dossier, :replied) } - let(:dossier2) { create(:dossier, :replied, procedure: dossier.procedure) } + let(:dossier) { create(:dossier, :initiated) } + let(:dossier2) { create(:dossier, :initiated, procedure: dossier.procedure) } let(:gestionnaire) { create(:gestionnaire) } before { gestionnaire.procedures << dossier2.procedure } @@ -26,7 +26,7 @@ describe NewGestionnaire::RecherchesController, type: :controller do end context 'when gestionnaire do not own the dossier' do - let(:dossier3) { create(:dossier, :replied) } + let(:dossier3) { create(:dossier, :initiated) } let(:query) { dossier3.id } it { is_expected.to have_http_status(200) } diff --git a/spec/controllers/users/commentaires_controller_spec.rb b/spec/controllers/users/commentaires_controller_spec.rb index 1be0021cf..1b05ff5ac 100644 --- a/spec/controllers/users/commentaires_controller_spec.rb +++ b/spec/controllers/users/commentaires_controller_spec.rb @@ -102,23 +102,5 @@ describe Users::CommentairesController, type: :controller do end end end - - describe 'change dossier state after post a comment' do - context 'when user is connected' do - context 'when dossier is at state replied' do - before do - sign_in dossier.user - dossier.replied! - - post :create, params: { dossier_id: dossier_id, texte_commentaire: texte_commentaire } - dossier.reload - end - - subject { dossier.state } - - it { is_expected.to eq('updated') } - end - end - end end end diff --git a/spec/controllers/users/dossiers/commentaires_controller_spec.rb b/spec/controllers/users/dossiers/commentaires_controller_spec.rb index 1fd067919..18908f468 100644 --- a/spec/controllers/users/dossiers/commentaires_controller_spec.rb +++ b/spec/controllers/users/dossiers/commentaires_controller_spec.rb @@ -15,13 +15,11 @@ describe Users::Dossiers::CommentairesController, type: :controller do before do sign_in invite.user - dossier.replied! end it do subject is_expected.to redirect_to users_dossiers_invite_path(invite.id) - expect(dossier.state).to eq 'replied' end it 'should notify user' do diff --git a/spec/decorators/dossier_decorator_spec.rb b/spec/decorators/dossier_decorator_spec.rb index 9920a89b4..e68943382 100644 --- a/spec/decorators/dossier_decorator_spec.rb +++ b/spec/decorators/dossier_decorator_spec.rb @@ -27,11 +27,6 @@ describe DossierDecorator do expect(subject).to eq('En construction') end - it 'replied is repondu' do - dossier.replied! - expect(subject).to eq('En construction') - end - it 'updated is mis à jour' do dossier.updated! expect(subject).to eq('En construction') diff --git a/spec/facades/admin_procedures_show_facades_spec.rb b/spec/facades/admin_procedures_show_facades_spec.rb index 781fb9393..f9b4a8234 100644 --- a/spec/facades/admin_procedures_show_facades_spec.rb +++ b/spec/facades/admin_procedures_show_facades_spec.rb @@ -5,7 +5,7 @@ describe AdminProceduresShowFacades do let!(:dossier_0) { create(:dossier, procedure: procedure, state: 'draft') } let!(:dossier_1) { create(:dossier, procedure: procedure, state: 'initiated') } - let!(:dossier_2) { create(:dossier, procedure: procedure, state: 'replied') } + let!(:dossier_2) { create(:dossier, procedure: procedure, state: 'initiated') } let!(:dossier_6) { create(:dossier, procedure: procedure, archived: true, state: 'initiated') } let!(:dossier_7) { create(:dossier, procedure: procedure, state: 'updated') } diff --git a/spec/factories/dossier.rb b/spec/factories/dossier.rb index 62c6c6dc0..036d498ca 100644 --- a/spec/factories/dossier.rb +++ b/spec/factories/dossier.rb @@ -72,8 +72,8 @@ FactoryGirl.define do end end - trait :replied do - state 'replied' + trait :initiated do + state 'initiated' end end end diff --git a/spec/features/users/flux_de_commentaires_spec.rb b/spec/features/users/flux_de_commentaires_spec.rb index 4ce44cd3e..734db0d78 100644 --- a/spec/features/users/flux_de_commentaires_spec.rb +++ b/spec/features/users/flux_de_commentaires_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' feature 'users: flux de commentaires' do let(:user) { create(:user) } - let(:dossier) { create(:dossier, :with_entreprise, user: user, state: "replied") } + let(:dossier) { create(:dossier, :with_entreprise, user: user, state: "initiated") } let(:dossier_id) { dossier.id } let(:champ1) { dossier.champs.first } diff --git a/spec/features/users/list_dossiers_spec.rb b/spec/features/users/list_dossiers_spec.rb index 6acdbfb50..64a55d0b2 100644 --- a/spec/features/users/list_dossiers_spec.rb +++ b/spec/features/users/list_dossiers_spec.rb @@ -2,10 +2,10 @@ require 'spec_helper' describe 'user access to the list of his dossier' do let(:user) { create(:user) } - let!(:last_updated_dossier) { create(:dossier, :with_entreprise, user: user, state: 'replied')} - let!(:dossier1) { create(:dossier, :with_entreprise, user: user, state: 'replied') } + let!(:last_updated_dossier) { create(:dossier, :with_entreprise, user: user, state: 'initiated')} + let!(:dossier1) { create(:dossier, :with_entreprise, user: user, state: 'initiated') } let!(:dossier2) { create(:dossier, :with_entreprise) } - let!(:dossier_archived) { create(:dossier, :with_entreprise, user: user, state: 'replied') } + let!(:dossier_archived) { create(:dossier, :with_entreprise, user: user, state: 'initiated') } before do last_updated_dossier.update_column(:updated_at, "19/07/2052 15:35".to_time) diff --git a/spec/features/users/onglets_link_spec.rb b/spec/features/users/onglets_link_spec.rb index a3fef2dc3..a229087b8 100644 --- a/spec/features/users/onglets_link_spec.rb +++ b/spec/features/users/onglets_link_spec.rb @@ -7,7 +7,6 @@ feature 'on click on tabs button' do before do create(:dossier, :with_entreprise, user: user, state: 'initiated') - create(:dossier, :with_entreprise, user: user, state: 'replied') create(:dossier, :with_entreprise, user: user, state: 'updated') create(:dossier, :with_entreprise, user: user, state: 'received') create(:dossier, :with_entreprise, user: user, state: 'closed') @@ -23,7 +22,7 @@ feature 'on click on tabs button' do context 'when he click on tabs en construction' do before do visit users_dossiers_url(liste: :a_traiter) - page.click_on 'En construction 3' + page.click_on 'En construction 2' end scenario 'it redirect to users dossier termine' do diff --git a/spec/models/dossier_spec.rb b/spec/models/dossier_spec.rb index a0edb21b7..e8db47137 100644 --- a/spec/models/dossier_spec.rb +++ b/spec/models/dossier_spec.rb @@ -182,7 +182,7 @@ describe Dossier do context 'when is post a comment' do let(:action) { 'comment' } - it { is_expected.to eq('replied') } + it { is_expected.to eq('initiated') } end context 'when is follow' do @@ -193,44 +193,6 @@ describe Dossier do end end - context 'when dossier is at state replied' do - before do - dossier.replied! - end - - context 'when user is connect' do - let(:role) { 'user' } - - context 'when is post a comment' do - let(:action) { 'comment' } - - it { is_expected.to eq('updated') } - end - - context 'when is updated dossier informations' do - let(:action) { 'update' } - - it { is_expected.to eq('updated') } - end - end - - context 'when gestionnaire is connect' do - let(:role) { 'gestionnaire' } - - context 'when is post a comment' do - let(:action) { 'comment' } - - it { is_expected.to eq('replied') } - end - - context 'when is follow' do - let(:action) { 'follow' } - - it { is_expected.to eq 'replied' } - end - end - end - context 'when dossier is at state updated' do before do dossier.updated! @@ -258,7 +220,7 @@ describe Dossier do context 'when is post a comment' do let(:action) { 'comment' } - it { is_expected.to eq('replied') } + it { is_expected.to eq('initiated') } end end end diff --git a/spec/models/procedure_spec.rb b/spec/models/procedure_spec.rb index 249b21931..4a0244e23 100644 --- a/spec/models/procedure_spec.rb +++ b/spec/models/procedure_spec.rb @@ -309,7 +309,7 @@ describe Procedure do before do create :dossier, procedure: procedure, state: :initiated create :dossier, procedure: procedure, state: :draft - create :dossier, procedure: procedure, state: :replied + create :dossier, procedure: procedure, state: :initiated end subject { procedure.total_dossier } diff --git a/spec/services/dossiers_list_gestionnaire_service_spec.rb b/spec/services/dossiers_list_gestionnaire_service_spec.rb index 3af0796b9..2e1e8d164 100644 --- a/spec/services/dossiers_list_gestionnaire_service_spec.rb +++ b/spec/services/dossiers_list_gestionnaire_service_spec.rb @@ -348,8 +348,6 @@ describe DossiersListGestionnaireService do let!(:dossier) { create(:dossier, procedure: procedure, state: 'draft') } let!(:dossier2) { create(:dossier, procedure: procedure, state: 'initiated') } #nouveaux let!(:dossier3) { create(:dossier, procedure: procedure, state: 'initiated') } #nouveaux - let!(:dossier4) { create(:dossier, procedure: procedure, state: 'replied') } #en_attente - let!(:dossier5) { create(:dossier, procedure: procedure, state: 'updated') } #a_traiter let!(:dossier6) { create(:dossier, procedure: procedure, state: 'received') } #a_instruire let!(:dossier7) { create(:dossier, procedure: procedure, state: 'received') } #a_instruire let!(:dossier8) { create(:dossier, procedure: procedure, state: 'closed') } #termine @@ -357,7 +355,6 @@ describe DossiersListGestionnaireService do let!(:dossier10) { create(:dossier, procedure: procedure, state: 'without_continuation') } #termine let!(:dossier11) { create(:dossier, procedure: procedure, state: 'closed') } #termine let!(:dossier12) { create(:dossier, procedure: procedure, state: 'initiated', archived: true) } #a_traiter #archived - let!(:dossier13) { create(:dossier, procedure: procedure, state: 'replied', archived: true) } #en_attente #archived let!(:dossier14) { create(:dossier, procedure: procedure, state: 'closed', archived: true) } #termine #archived describe '#termine' do diff --git a/spec/services/user_routes_authorization_service_spec.rb b/spec/services/user_routes_authorization_service_spec.rb index 4bbb7d825..699d16778 100644 --- a/spec/services/user_routes_authorization_service_spec.rb +++ b/spec/services/user_routes_authorization_service_spec.rb @@ -23,11 +23,6 @@ describe UserRoutesAuthorizationService do it { is_expected.to be_falsey } end - describe 'replied' do - let(:state) { 'replied' } - it { is_expected.to be_falsey } - end - describe 'updated' do let(:state) { 'updated' } it { is_expected.to be_falsey } @@ -53,11 +48,6 @@ describe UserRoutesAuthorizationService do it { is_expected.to be_falsey } end - describe 'replied' do - let(:state) { 'replied' } - it { is_expected.to be_falsey } - end - describe 'updated' do let(:state) { 'updated' } it { is_expected.to be_falsey } @@ -82,11 +72,6 @@ describe UserRoutesAuthorizationService do it { is_expected.to be_truthy } end - describe 'replied' do - let(:state) { 'replied' } - it { is_expected.to be_truthy } - end - describe 'updated' do let(:state) { 'updated' } it { is_expected.to be_truthy } @@ -112,11 +97,6 @@ describe UserRoutesAuthorizationService do it { is_expected.to be_truthy } end - describe 'replied' do - let(:state) { 'replied' } - it { is_expected.to be_truthy } - end - describe 'updated' do let(:state) { 'updated' } it { is_expected.to be_truthy } @@ -141,11 +121,6 @@ describe UserRoutesAuthorizationService do it { is_expected.to be_truthy } end - describe 'replied' do - let(:state) { 'replied' } - it { is_expected.to be_truthy } - end - describe 'updated' do let(:state) { 'updated' } it { is_expected.to be_truthy } diff --git a/spec/views/backoffice/dossiers/index_html.haml_spec.rb b/spec/views/backoffice/dossiers/index_html.haml_spec.rb index 539e2c4f9..9781882b0 100644 --- a/spec/views/backoffice/dossiers/index_html.haml_spec.rb +++ b/spec/views/backoffice/dossiers/index_html.haml_spec.rb @@ -7,7 +7,6 @@ describe 'backoffice/dossiers/index.html.haml', type: :view do let!(:procedure) { create(:procedure, :published, administrateur: administrateur) } let!(:decorate_dossier_initiated) { create(:dossier, :with_entreprise, procedure: procedure, state: 'initiated').decorate } - let!(:decorate_dossier_replied) { create(:dossier, :with_entreprise, procedure: procedure, state: 'replied').decorate } let!(:decorate_dossier_updated) { create(:dossier, :with_entreprise, procedure: procedure, state: 'updated').decorate } let!(:decorate_dossier_received) { create(:dossier, :with_entreprise, procedure: procedure, state: 'received').decorate } let!(:decorate_dossier_closed) { create(:dossier, :with_entreprise, procedure: procedure, state: 'closed').decorate } @@ -21,7 +20,6 @@ describe 'backoffice/dossiers/index.html.haml', type: :view do let(:all_state_dossiers_list) { dossiers_list_facade.service.all_state } before do - decorate_dossier_replied.entreprise.update_column(:raison_sociale, 'plap') decorate_dossier_updated.entreprise.update_column(:raison_sociale, 'plep') decorate_dossier_received.entreprise.update_column(:raison_sociale, 'plup') decorate_dossier_closed.entreprise.update_column(:raison_sociale, 'plyp') @@ -79,14 +77,13 @@ describe 'backoffice/dossiers/index.html.haml', type: :view do it { is_expected.to have_content('Nouveaux dossiers 1 dossier') } it { is_expected.to have_content('Dossiers suivis 0 dossiers') } - it { is_expected.to have_content('Tous les dossiers 7 dossiers') } + it { is_expected.to have_content('Tous les dossiers 6 dossiers') } it { is_expected.to have_content('État') } it { is_expected.to have_content('Libellé procédure') } it { is_expected.to have_content('Raison sociale') } it { is_expected.to have_content('Mise à jour le') } - it { is_expected.to have_content('plap') } it { is_expected.to have_content('plep') } it { is_expected.to have_content('plup') } it { is_expected.to have_content('plyp') } diff --git a/spec/views/layouts/left_panels/_left_panel_backoffice_dossierscontroller_show_spec.rb b/spec/views/layouts/left_panels/_left_panel_backoffice_dossierscontroller_show_spec.rb index 4682bb331..cf19e5c4a 100644 --- a/spec/views/layouts/left_panels/_left_panel_backoffice_dossierscontroller_show_spec.rb +++ b/spec/views/layouts/left_panels/_left_panel_backoffice_dossierscontroller_show_spec.rb @@ -40,18 +40,6 @@ describe 'layouts/left_panels/_left_panel_backoffice_dossierscontroller_show.htm include_examples 'button Passer en instruction is present' end - context 'when dossier have state replied' do - let(:state) { 'replied' } - - before do - render - end - - it { expect(rendered).to have_content('En construction') } - - include_examples 'button Passer en instruction is present' - end - context 'when dossier have state update' do let(:state) { 'updated' } diff --git a/spec/views/layouts/left_panels/_left_panel_users_recapitulatifcontroller_show_spec.rb b/spec/views/layouts/left_panels/_left_panel_users_recapitulatifcontroller_show_spec.rb index f580715a9..54e4a0498 100644 --- a/spec/views/layouts/left_panels/_left_panel_users_recapitulatifcontroller_show_spec.rb +++ b/spec/views/layouts/left_panels/_left_panel_users_recapitulatifcontroller_show_spec.rb @@ -20,16 +20,6 @@ describe 'layouts/left_panels/_left_panel_users_recapitulatifcontroller_show.htm it { expect(rendered).to have_content('En construction') } end - context 'when dossier state is replied' do - let(:state) { 'replied' } - - before do - render - end - - it { expect(rendered).to have_content('En construction') } - end - context 'when dossier state is updated' do let(:state) { 'updated' } diff --git a/spec/views/new_gestionnaire/dossiers/show.html.haml_spec.rb b/spec/views/new_gestionnaire/dossiers/show.html.haml_spec.rb index 1e4f01b32..33a02b377 100644 --- a/spec/views/new_gestionnaire/dossiers/show.html.haml_spec.rb +++ b/spec/views/new_gestionnaire/dossiers/show.html.haml_spec.rb @@ -1,7 +1,7 @@ describe 'new_gestionnaire/dossiers/show.html.haml', type: :view do let(:individual) { nil } let(:entreprise) { nil } - let(:dossier) { create(:dossier, :replied, entreprise: entreprise, individual: individual) } + let(:dossier) { create(:dossier, :initiated, entreprise: entreprise, individual: individual) } before do assign(:dossier, dossier) diff --git a/spec/views/users/dossiers/index_html.haml_spec.rb b/spec/views/users/dossiers/index_html.haml_spec.rb index dc6721b41..39aaed776 100644 --- a/spec/views/users/dossiers/index_html.haml_spec.rb +++ b/spec/views/users/dossiers/index_html.haml_spec.rb @@ -4,7 +4,6 @@ describe 'users/dossiers/index.html.haml', type: :view do let(:user) { create(:user) } let!(:decorate_dossier_initiated) { create(:dossier, :with_entreprise, user: user, state: 'initiated').decorate } - let!(:decorate_dossier_replied) { create(:dossier, :with_entreprise, user: user, state: 'replied').decorate } let!(:decorate_dossier_updated) { create(:dossier, :with_entreprise, user: user, state: 'updated').decorate } let!(:decorate_dossier_received) { create(:dossier, :with_entreprise, user: user, state: 'received').decorate } let!(:decorate_dossier_closed) { create(:dossier, :with_entreprise, user: user, state: 'closed').decorate } @@ -41,7 +40,7 @@ describe 'users/dossiers/index.html.haml', type: :view do end describe 'on tab en construction' do - let(:total_dossiers) { 3 } + let(:total_dossiers) { 2 } let(:active_class) { '.active .text-danger' } let(:dossiers_to_display) { user.dossiers.state_en_construction } let(:liste) { 'a_traiter' } @@ -50,10 +49,6 @@ describe 'users/dossiers/index.html.haml', type: :view do let(:decorate_dossier_at_check) { decorate_dossier_initiated } end - it_behaves_like 'check_tab_content' do - let(:decorate_dossier_at_check) { decorate_dossier_replied } - end - it_behaves_like 'check_tab_content' do let(:decorate_dossier_at_check) { decorate_dossier_updated } end diff --git a/spec/workers/auto_archive_procedure_worker_spec.rb b/spec/workers/auto_archive_procedure_worker_spec.rb index 9b4c57d81..c76e297d5 100644 --- a/spec/workers/auto_archive_procedure_worker_spec.rb +++ b/spec/workers/auto_archive_procedure_worker_spec.rb @@ -20,7 +20,7 @@ RSpec.describe AutoArchiveProcedureWorker, type: :worker do context "when procedures have auto_archive_on set on yesterday or today" do let!(:dossier1) { create(:dossier, procedure: procedure_hier, state: 'draft', archived: false)} let!(:dossier2) { create(:dossier, procedure: procedure_hier, state: 'initiated', archived: false)} - let!(:dossier3) { create(:dossier, procedure: procedure_hier, state: 'replied', archived: false)} + let!(:dossier3) { create(:dossier, procedure: procedure_hier, state: 'initiated', archived: false)} let!(:dossier4) { create(:dossier, procedure: procedure_hier, state: 'updated', archived: false)} let!(:dossier5) { create(:dossier, procedure: procedure_hier, state: 'received', archived: false)} let!(:dossier6) { create(:dossier, procedure: procedure_hier, state: 'closed', archived: false)}