[Fix #503] Dossier: remove replied
This commit is contained in:
parent
030a11d98c
commit
633b55aca0
32 changed files with 37 additions and 169 deletions
|
@ -179,7 +179,7 @@ class Backoffice::DossiersController < Backoffice::DossiersListController
|
||||||
def reopen
|
def reopen
|
||||||
create_dossier_facade params[:dossier_id]
|
create_dossier_facade params[:dossier_id]
|
||||||
|
|
||||||
@facade.dossier.replied!
|
@facade.dossier.initiated!
|
||||||
flash.notice = 'Dossier repassé en construction.'
|
flash.notice = 'Dossier repassé en construction.'
|
||||||
|
|
||||||
redirect_to_dossier(@facade.dossier)
|
redirect_to_dossier(@facade.dossier)
|
||||||
|
|
|
@ -56,7 +56,7 @@ class Users::CarteController < UsersController
|
||||||
|
|
||||||
def self.route_authorization
|
def self.route_authorization
|
||||||
{
|
{
|
||||||
states: [:draft, :initiated, :replied, :updated],
|
states: [:draft, :initiated, :updated],
|
||||||
api_carto: true
|
api_carto: true
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
|
@ -93,7 +93,7 @@ class Users::DescriptionController < UsersController
|
||||||
|
|
||||||
def self.route_authorization
|
def self.route_authorization
|
||||||
{
|
{
|
||||||
states: [:draft, :initiated, :replied, :updated]
|
states: [:draft, :initiated, :updated]
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ class Users::RecapitulatifController < UsersController
|
||||||
|
|
||||||
def self.route_authorization
|
def self.route_authorization
|
||||||
{
|
{
|
||||||
states: [:initiated, :replied, :updated, :received, :without_continuation, :closed, :refused]
|
states: [:initiated, :updated, :received, :without_continuation, :closed, :refused]
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,6 @@ class Dossier < ActiveRecord::Base
|
||||||
enum state: {
|
enum state: {
|
||||||
draft: 'draft',
|
draft: 'draft',
|
||||||
initiated: 'initiated',
|
initiated: 'initiated',
|
||||||
replied: 'replied', # action utilisateur demandé
|
|
||||||
updated: 'updated', # etude par l'administration en cours
|
updated: 'updated', # etude par l'administration en cours
|
||||||
received: 'received',
|
received: 'received',
|
||||||
closed: 'closed',
|
closed: 'closed',
|
||||||
|
@ -12,7 +11,7 @@ class Dossier < ActiveRecord::Base
|
||||||
|
|
||||||
BROUILLON = %w(draft)
|
BROUILLON = %w(draft)
|
||||||
NOUVEAUX = %w(initiated)
|
NOUVEAUX = %w(initiated)
|
||||||
EN_CONSTRUCTION = %w(initiated updated replied)
|
EN_CONSTRUCTION = %w(initiated updated)
|
||||||
EN_INSTRUCTION = %w(received)
|
EN_INSTRUCTION = %w(received)
|
||||||
EN_CONSTRUCTION_OU_INSTRUCTION = EN_CONSTRUCTION + EN_INSTRUCTION
|
EN_CONSTRUCTION_OU_INSTRUCTION = EN_CONSTRUCTION + EN_INSTRUCTION
|
||||||
A_INSTRUIRE = %w(received)
|
A_INSTRUIRE = %w(received)
|
||||||
|
@ -161,22 +160,14 @@ class Dossier < ActiveRecord::Base
|
||||||
if draft?
|
if draft?
|
||||||
initiated!
|
initiated!
|
||||||
end
|
end
|
||||||
when 'update'
|
|
||||||
if replied?
|
|
||||||
updated!
|
|
||||||
end
|
|
||||||
when 'comment'
|
|
||||||
if replied?
|
|
||||||
updated!
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
when 'gestionnaire'
|
when 'gestionnaire'
|
||||||
case action
|
case action
|
||||||
when 'comment'
|
when 'comment'
|
||||||
if updated?
|
if updated?
|
||||||
replied!
|
initiated!
|
||||||
elsif initiated?
|
elsif initiated?
|
||||||
replied!
|
initiated!
|
||||||
end
|
end
|
||||||
when 'follow'
|
when 'follow'
|
||||||
if initiated?
|
if initiated?
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
.col-xs-8.title-no-expanse
|
.col-xs-8.title-no-expanse
|
||||||
.carret-right
|
.carret-right
|
||||||
INFORMATIONS DU DEMANDEUR
|
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) }
|
%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
|
.col-lg-4.col-md-4.col-sm-4.col-xs-4.action
|
||||||
Renseigner un SIRET
|
Renseigner un SIRET
|
||||||
|
|
|
@ -10,7 +10,6 @@ fr:
|
||||||
state:
|
state:
|
||||||
draft: "Brouillon"
|
draft: "Brouillon"
|
||||||
initiated: "En construction"
|
initiated: "En construction"
|
||||||
replied: "En construction"
|
|
||||||
updated: "En construction"
|
updated: "En construction"
|
||||||
received: "En instruction"
|
received: "En instruction"
|
||||||
closed: "Accepté"
|
closed: "Accepté"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe Backoffice::CommentairesController, type: :controller do
|
describe Backoffice::CommentairesController, type: :controller do
|
||||||
let(:dossier) { create(:dossier, :replied) }
|
let(:dossier) { create(:dossier, :initiated) }
|
||||||
let(:dossier_id) { dossier.id }
|
let(:dossier_id) { dossier.id }
|
||||||
let(:email_commentaire) { 'test@test.com' }
|
let(:email_commentaire) { 'test@test.com' }
|
||||||
let(:texte_commentaire) { 'Commentaire de test' }
|
let(:texte_commentaire) { 'Commentaire de test' }
|
||||||
|
@ -124,7 +124,7 @@ describe Backoffice::CommentairesController, type: :controller do
|
||||||
|
|
||||||
subject { dossier.state }
|
subject { dossier.state }
|
||||||
|
|
||||||
it { is_expected.to eq('replied') }
|
it { is_expected.to eq('initiated') }
|
||||||
|
|
||||||
it 'Notification email is send' do
|
it 'Notification email is send' do
|
||||||
expect(NotificationMailer).to receive(:new_answer).and_return(NotificationMailer)
|
expect(NotificationMailer).to receive(:new_answer).and_return(NotificationMailer)
|
||||||
|
|
|
@ -360,11 +360,11 @@ describe Backoffice::DossiersController, type: :controller do
|
||||||
|
|
||||||
subject { post :reopen, params: {dossier_id: dossier_id} }
|
subject { post :reopen, params: {dossier_id: dossier_id} }
|
||||||
|
|
||||||
it 'change state to replied' do
|
it 'change state to initiated' do
|
||||||
subject
|
subject
|
||||||
|
|
||||||
dossier.reload
|
dossier.reload
|
||||||
expect(dossier.state).to eq('replied')
|
expect(dossier.state).to eq('initiated')
|
||||||
end
|
end
|
||||||
|
|
||||||
it { is_expected.to redirect_to backoffice_dossier_path(id: dossier_id) }
|
it { is_expected.to redirect_to backoffice_dossier_path(id: dossier_id) }
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe InvitesController, type: :controller do
|
describe InvitesController, type: :controller do
|
||||||
let(:dossier) { create(:dossier, :replied) }
|
let(:dossier) { create(:dossier, :initiated) }
|
||||||
let(:email) { 'plop@octo.com' }
|
let(:email) { 'plop@octo.com' }
|
||||||
|
|
||||||
describe '#POST create' do
|
describe '#POST create' do
|
||||||
|
|
|
@ -6,7 +6,7 @@ describe NewGestionnaire::AvisController, type: :controller do
|
||||||
let(:claimant) { create(:gestionnaire) }
|
let(:claimant) { create(:gestionnaire) }
|
||||||
let(:gestionnaire) { create(:gestionnaire) }
|
let(:gestionnaire) { create(:gestionnaire) }
|
||||||
let(:procedure) { create(:procedure, :published, gestionnaires: [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_without_answer) { Avis.create(dossier: dossier, claimant: claimant, gestionnaire: gestionnaire) }
|
||||||
let!(:avis_with_answer) { Avis.create(dossier: dossier, claimant: claimant, gestionnaire: gestionnaire, answer: 'yop') }
|
let!(:avis_with_answer) { Avis.create(dossier: dossier, claimant: claimant, gestionnaire: gestionnaire, answer: 'yop') }
|
||||||
|
|
||||||
|
|
|
@ -5,16 +5,16 @@ describe NewGestionnaire::DossiersController, type: :controller do
|
||||||
|
|
||||||
let(:gestionnaire) { create(:gestionnaire) }
|
let(:gestionnaire) { create(:gestionnaire) }
|
||||||
let(:procedure) { create(:procedure, :published, gestionnaires: [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) }
|
before { sign_in(gestionnaire) }
|
||||||
|
|
||||||
describe '#attestation' do
|
describe '#attestation' do
|
||||||
context 'when a dossier has an attestation' do
|
context 'when a dossier has an attestation' do
|
||||||
let(:fake_pdf) { double(read: 'pdf content') }
|
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!(: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
|
it 'returns the attestation pdf' do
|
||||||
allow_any_instance_of(Attestation).to receive(:pdf).and_return(fake_pdf)
|
allow_any_instance_of(Attestation).to receive(:pdf).and_return(fake_pdf)
|
||||||
|
@ -148,7 +148,7 @@ describe NewGestionnaire::DossiersController, type: :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
let(:dossier) do
|
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
|
end
|
||||||
|
|
||||||
before do
|
before do
|
||||||
|
|
|
@ -137,7 +137,7 @@ describe NewGestionnaire::ProceduresController, type: :controller do
|
||||||
let(:state) { "initiated" }
|
let(:state) { "initiated" }
|
||||||
|
|
||||||
before do
|
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: "received")
|
||||||
create(:dossier, procedure: procedure, state: "without_continuation", archived: true)
|
create(:dossier, procedure: procedure, state: "without_continuation", archived: true)
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe NewGestionnaire::RecherchesController, type: :controller do
|
describe NewGestionnaire::RecherchesController, type: :controller do
|
||||||
let(:dossier) { create(:dossier, :replied) }
|
let(:dossier) { create(:dossier, :initiated) }
|
||||||
let(:dossier2) { create(:dossier, :replied, procedure: dossier.procedure) }
|
let(:dossier2) { create(:dossier, :initiated, procedure: dossier.procedure) }
|
||||||
let(:gestionnaire) { create(:gestionnaire) }
|
let(:gestionnaire) { create(:gestionnaire) }
|
||||||
|
|
||||||
before { gestionnaire.procedures << dossier2.procedure }
|
before { gestionnaire.procedures << dossier2.procedure }
|
||||||
|
@ -26,7 +26,7 @@ describe NewGestionnaire::RecherchesController, type: :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when gestionnaire do not own the dossier' do
|
context 'when gestionnaire do not own the dossier' do
|
||||||
let(:dossier3) { create(:dossier, :replied) }
|
let(:dossier3) { create(:dossier, :initiated) }
|
||||||
let(:query) { dossier3.id }
|
let(:query) { dossier3.id }
|
||||||
|
|
||||||
it { is_expected.to have_http_status(200) }
|
it { is_expected.to have_http_status(200) }
|
||||||
|
|
|
@ -102,23 +102,5 @@ describe Users::CommentairesController, type: :controller do
|
||||||
end
|
end
|
||||||
end
|
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
|
||||||
end
|
end
|
||||||
|
|
|
@ -15,13 +15,11 @@ describe Users::Dossiers::CommentairesController, type: :controller do
|
||||||
|
|
||||||
before do
|
before do
|
||||||
sign_in invite.user
|
sign_in invite.user
|
||||||
dossier.replied!
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it do
|
it do
|
||||||
subject
|
subject
|
||||||
is_expected.to redirect_to users_dossiers_invite_path(invite.id)
|
is_expected.to redirect_to users_dossiers_invite_path(invite.id)
|
||||||
expect(dossier.state).to eq 'replied'
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should notify user' do
|
it 'should notify user' do
|
||||||
|
|
|
@ -27,11 +27,6 @@ describe DossierDecorator do
|
||||||
expect(subject).to eq('En construction')
|
expect(subject).to eq('En construction')
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'replied is repondu' do
|
|
||||||
dossier.replied!
|
|
||||||
expect(subject).to eq('En construction')
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'updated is mis à jour' do
|
it 'updated is mis à jour' do
|
||||||
dossier.updated!
|
dossier.updated!
|
||||||
expect(subject).to eq('En construction')
|
expect(subject).to eq('En construction')
|
||||||
|
|
|
@ -5,7 +5,7 @@ describe AdminProceduresShowFacades do
|
||||||
|
|
||||||
let!(:dossier_0) { create(:dossier, procedure: procedure, state: 'draft') }
|
let!(:dossier_0) { create(:dossier, procedure: procedure, state: 'draft') }
|
||||||
let!(:dossier_1) { create(:dossier, procedure: procedure, state: 'initiated') }
|
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_6) { create(:dossier, procedure: procedure, archived: true, state: 'initiated') }
|
||||||
let!(:dossier_7) { create(:dossier, procedure: procedure, state: 'updated') }
|
let!(:dossier_7) { create(:dossier, procedure: procedure, state: 'updated') }
|
||||||
|
|
||||||
|
|
|
@ -72,8 +72,8 @@ FactoryGirl.define do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
trait :replied do
|
trait :initiated do
|
||||||
state 'replied'
|
state 'initiated'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,7 +2,7 @@ require 'spec_helper'
|
||||||
|
|
||||||
feature 'users: flux de commentaires' do
|
feature 'users: flux de commentaires' do
|
||||||
let(:user) { create(:user) }
|
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(:dossier_id) { dossier.id }
|
||||||
|
|
||||||
let(:champ1) { dossier.champs.first }
|
let(:champ1) { dossier.champs.first }
|
||||||
|
|
|
@ -2,10 +2,10 @@ require 'spec_helper'
|
||||||
|
|
||||||
describe 'user access to the list of his dossier' do
|
describe 'user access to the list of his dossier' do
|
||||||
let(:user) { create(:user) }
|
let(:user) { create(:user) }
|
||||||
let!(:last_updated_dossier) { 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: 'replied') }
|
let!(:dossier1) { create(:dossier, :with_entreprise, user: user, state: 'initiated') }
|
||||||
let!(:dossier2) { create(:dossier, :with_entreprise) }
|
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
|
before do
|
||||||
last_updated_dossier.update_column(:updated_at, "19/07/2052 15:35".to_time)
|
last_updated_dossier.update_column(:updated_at, "19/07/2052 15:35".to_time)
|
||||||
|
|
|
@ -7,7 +7,6 @@ feature 'on click on tabs button' do
|
||||||
|
|
||||||
before do
|
before do
|
||||||
create(:dossier, :with_entreprise, user: user, state: 'initiated')
|
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: 'updated')
|
||||||
create(:dossier, :with_entreprise, user: user, state: 'received')
|
create(:dossier, :with_entreprise, user: user, state: 'received')
|
||||||
create(:dossier, :with_entreprise, user: user, state: 'closed')
|
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
|
context 'when he click on tabs en construction' do
|
||||||
before do
|
before do
|
||||||
visit users_dossiers_url(liste: :a_traiter)
|
visit users_dossiers_url(liste: :a_traiter)
|
||||||
page.click_on 'En construction 3'
|
page.click_on 'En construction 2'
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario 'it redirect to users dossier termine' do
|
scenario 'it redirect to users dossier termine' do
|
||||||
|
|
|
@ -182,7 +182,7 @@ describe Dossier do
|
||||||
context 'when is post a comment' do
|
context 'when is post a comment' do
|
||||||
let(:action) { 'comment' }
|
let(:action) { 'comment' }
|
||||||
|
|
||||||
it { is_expected.to eq('replied') }
|
it { is_expected.to eq('initiated') }
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when is follow' do
|
context 'when is follow' do
|
||||||
|
@ -193,44 +193,6 @@ describe Dossier do
|
||||||
end
|
end
|
||||||
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
|
context 'when dossier is at state updated' do
|
||||||
before do
|
before do
|
||||||
dossier.updated!
|
dossier.updated!
|
||||||
|
@ -258,7 +220,7 @@ describe Dossier do
|
||||||
context 'when is post a comment' do
|
context 'when is post a comment' do
|
||||||
let(:action) { 'comment' }
|
let(:action) { 'comment' }
|
||||||
|
|
||||||
it { is_expected.to eq('replied') }
|
it { is_expected.to eq('initiated') }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -309,7 +309,7 @@ describe Procedure do
|
||||||
before do
|
before do
|
||||||
create :dossier, procedure: procedure, state: :initiated
|
create :dossier, procedure: procedure, state: :initiated
|
||||||
create :dossier, procedure: procedure, state: :draft
|
create :dossier, procedure: procedure, state: :draft
|
||||||
create :dossier, procedure: procedure, state: :replied
|
create :dossier, procedure: procedure, state: :initiated
|
||||||
end
|
end
|
||||||
|
|
||||||
subject { procedure.total_dossier }
|
subject { procedure.total_dossier }
|
||||||
|
|
|
@ -348,8 +348,6 @@ describe DossiersListGestionnaireService do
|
||||||
let!(:dossier) { create(:dossier, procedure: procedure, state: 'draft') }
|
let!(:dossier) { create(:dossier, procedure: procedure, state: 'draft') }
|
||||||
let!(:dossier2) { create(:dossier, procedure: procedure, state: 'initiated') } #nouveaux
|
let!(:dossier2) { create(:dossier, procedure: procedure, state: 'initiated') } #nouveaux
|
||||||
let!(:dossier3) { 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!(:dossier6) { create(:dossier, procedure: procedure, state: 'received') } #a_instruire
|
||||||
let!(:dossier7) { 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
|
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!(:dossier10) { create(:dossier, procedure: procedure, state: 'without_continuation') } #termine
|
||||||
let!(:dossier11) { create(:dossier, procedure: procedure, state: 'closed') } #termine
|
let!(:dossier11) { create(:dossier, procedure: procedure, state: 'closed') } #termine
|
||||||
let!(:dossier12) { create(:dossier, procedure: procedure, state: 'initiated', archived: true) } #a_traiter #archived
|
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
|
let!(:dossier14) { create(:dossier, procedure: procedure, state: 'closed', archived: true) } #termine #archived
|
||||||
|
|
||||||
describe '#termine' do
|
describe '#termine' do
|
||||||
|
|
|
@ -23,11 +23,6 @@ describe UserRoutesAuthorizationService do
|
||||||
it { is_expected.to be_falsey }
|
it { is_expected.to be_falsey }
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'replied' do
|
|
||||||
let(:state) { 'replied' }
|
|
||||||
it { is_expected.to be_falsey }
|
|
||||||
end
|
|
||||||
|
|
||||||
describe 'updated' do
|
describe 'updated' do
|
||||||
let(:state) { 'updated' }
|
let(:state) { 'updated' }
|
||||||
it { is_expected.to be_falsey }
|
it { is_expected.to be_falsey }
|
||||||
|
@ -53,11 +48,6 @@ describe UserRoutesAuthorizationService do
|
||||||
it { is_expected.to be_falsey }
|
it { is_expected.to be_falsey }
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'replied' do
|
|
||||||
let(:state) { 'replied' }
|
|
||||||
it { is_expected.to be_falsey }
|
|
||||||
end
|
|
||||||
|
|
||||||
describe 'updated' do
|
describe 'updated' do
|
||||||
let(:state) { 'updated' }
|
let(:state) { 'updated' }
|
||||||
it { is_expected.to be_falsey }
|
it { is_expected.to be_falsey }
|
||||||
|
@ -82,11 +72,6 @@ describe UserRoutesAuthorizationService do
|
||||||
it { is_expected.to be_truthy }
|
it { is_expected.to be_truthy }
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'replied' do
|
|
||||||
let(:state) { 'replied' }
|
|
||||||
it { is_expected.to be_truthy }
|
|
||||||
end
|
|
||||||
|
|
||||||
describe 'updated' do
|
describe 'updated' do
|
||||||
let(:state) { 'updated' }
|
let(:state) { 'updated' }
|
||||||
it { is_expected.to be_truthy }
|
it { is_expected.to be_truthy }
|
||||||
|
@ -112,11 +97,6 @@ describe UserRoutesAuthorizationService do
|
||||||
it { is_expected.to be_truthy }
|
it { is_expected.to be_truthy }
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'replied' do
|
|
||||||
let(:state) { 'replied' }
|
|
||||||
it { is_expected.to be_truthy }
|
|
||||||
end
|
|
||||||
|
|
||||||
describe 'updated' do
|
describe 'updated' do
|
||||||
let(:state) { 'updated' }
|
let(:state) { 'updated' }
|
||||||
it { is_expected.to be_truthy }
|
it { is_expected.to be_truthy }
|
||||||
|
@ -141,11 +121,6 @@ describe UserRoutesAuthorizationService do
|
||||||
it { is_expected.to be_truthy }
|
it { is_expected.to be_truthy }
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'replied' do
|
|
||||||
let(:state) { 'replied' }
|
|
||||||
it { is_expected.to be_truthy }
|
|
||||||
end
|
|
||||||
|
|
||||||
describe 'updated' do
|
describe 'updated' do
|
||||||
let(:state) { 'updated' }
|
let(:state) { 'updated' }
|
||||||
it { is_expected.to be_truthy }
|
it { is_expected.to be_truthy }
|
||||||
|
|
|
@ -7,7 +7,6 @@ describe 'backoffice/dossiers/index.html.haml', type: :view do
|
||||||
let!(:procedure) { create(:procedure, :published, administrateur: administrateur) }
|
let!(:procedure) { create(:procedure, :published, administrateur: administrateur) }
|
||||||
|
|
||||||
let!(:decorate_dossier_initiated) { create(:dossier, :with_entreprise, procedure: procedure, state: 'initiated').decorate }
|
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_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_received) { create(:dossier, :with_entreprise, procedure: procedure, state: 'received').decorate }
|
||||||
let!(:decorate_dossier_closed) { create(:dossier, :with_entreprise, procedure: procedure, state: 'closed').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 }
|
let(:all_state_dossiers_list) { dossiers_list_facade.service.all_state }
|
||||||
|
|
||||||
before do
|
before do
|
||||||
decorate_dossier_replied.entreprise.update_column(:raison_sociale, 'plap')
|
|
||||||
decorate_dossier_updated.entreprise.update_column(:raison_sociale, 'plep')
|
decorate_dossier_updated.entreprise.update_column(:raison_sociale, 'plep')
|
||||||
decorate_dossier_received.entreprise.update_column(:raison_sociale, 'plup')
|
decorate_dossier_received.entreprise.update_column(:raison_sociale, 'plup')
|
||||||
decorate_dossier_closed.entreprise.update_column(:raison_sociale, 'plyp')
|
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('Nouveaux dossiers 1 dossier') }
|
||||||
it { is_expected.to have_content('Dossiers suivis 0 dossiers') }
|
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('État') }
|
||||||
it { is_expected.to have_content('Libellé procédure') }
|
it { is_expected.to have_content('Libellé procédure') }
|
||||||
it { is_expected.to have_content('Raison sociale') }
|
it { is_expected.to have_content('Raison sociale') }
|
||||||
it { is_expected.to have_content('Mise à jour le') }
|
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('plep') }
|
||||||
it { is_expected.to have_content('plup') }
|
it { is_expected.to have_content('plup') }
|
||||||
it { is_expected.to have_content('plyp') }
|
it { is_expected.to have_content('plyp') }
|
||||||
|
|
|
@ -40,18 +40,6 @@ describe 'layouts/left_panels/_left_panel_backoffice_dossierscontroller_show.htm
|
||||||
include_examples 'button Passer en instruction is present'
|
include_examples 'button Passer en instruction is present'
|
||||||
end
|
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
|
context 'when dossier have state update' do
|
||||||
let(:state) { 'updated' }
|
let(:state) { 'updated' }
|
||||||
|
|
||||||
|
|
|
@ -20,16 +20,6 @@ describe 'layouts/left_panels/_left_panel_users_recapitulatifcontroller_show.htm
|
||||||
it { expect(rendered).to have_content('En construction') }
|
it { expect(rendered).to have_content('En construction') }
|
||||||
end
|
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
|
context 'when dossier state is updated' do
|
||||||
let(:state) { 'updated' }
|
let(:state) { 'updated' }
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
describe 'new_gestionnaire/dossiers/show.html.haml', type: :view do
|
describe 'new_gestionnaire/dossiers/show.html.haml', type: :view do
|
||||||
let(:individual) { nil }
|
let(:individual) { nil }
|
||||||
let(:entreprise) { nil }
|
let(:entreprise) { nil }
|
||||||
let(:dossier) { create(:dossier, :replied, entreprise: entreprise, individual: individual) }
|
let(:dossier) { create(:dossier, :initiated, entreprise: entreprise, individual: individual) }
|
||||||
|
|
||||||
before do
|
before do
|
||||||
assign(:dossier, dossier)
|
assign(:dossier, dossier)
|
||||||
|
|
|
@ -4,7 +4,6 @@ describe 'users/dossiers/index.html.haml', type: :view do
|
||||||
let(:user) { create(:user) }
|
let(:user) { create(:user) }
|
||||||
|
|
||||||
let!(:decorate_dossier_initiated) { create(:dossier, :with_entreprise, user: user, state: 'initiated').decorate }
|
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_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_received) { create(:dossier, :with_entreprise, user: user, state: 'received').decorate }
|
||||||
let!(:decorate_dossier_closed) { create(:dossier, :with_entreprise, user: user, state: 'closed').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
|
end
|
||||||
|
|
||||||
describe 'on tab en construction' do
|
describe 'on tab en construction' do
|
||||||
let(:total_dossiers) { 3 }
|
let(:total_dossiers) { 2 }
|
||||||
let(:active_class) { '.active .text-danger' }
|
let(:active_class) { '.active .text-danger' }
|
||||||
let(:dossiers_to_display) { user.dossiers.state_en_construction }
|
let(:dossiers_to_display) { user.dossiers.state_en_construction }
|
||||||
let(:liste) { 'a_traiter' }
|
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 }
|
let(:decorate_dossier_at_check) { decorate_dossier_initiated }
|
||||||
end
|
end
|
||||||
|
|
||||||
it_behaves_like 'check_tab_content' do
|
|
||||||
let(:decorate_dossier_at_check) { decorate_dossier_replied }
|
|
||||||
end
|
|
||||||
|
|
||||||
it_behaves_like 'check_tab_content' do
|
it_behaves_like 'check_tab_content' do
|
||||||
let(:decorate_dossier_at_check) { decorate_dossier_updated }
|
let(:decorate_dossier_at_check) { decorate_dossier_updated }
|
||||||
end
|
end
|
||||||
|
|
|
@ -20,7 +20,7 @@ RSpec.describe AutoArchiveProcedureWorker, type: :worker do
|
||||||
context "when procedures have auto_archive_on set on yesterday or today" 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!(:dossier1) { create(:dossier, procedure: procedure_hier, state: 'draft', archived: false)}
|
||||||
let!(:dossier2) { create(:dossier, procedure: procedure_hier, state: 'initiated', 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!(:dossier4) { create(:dossier, procedure: procedure_hier, state: 'updated', archived: false)}
|
||||||
let!(:dossier5) { create(:dossier, procedure: procedure_hier, state: 'received', archived: false)}
|
let!(:dossier5) { create(:dossier, procedure: procedure_hier, state: 'received', archived: false)}
|
||||||
let!(:dossier6) { create(:dossier, procedure: procedure_hier, state: 'closed', archived: false)}
|
let!(:dossier6) { create(:dossier, procedure: procedure_hier, state: 'closed', archived: false)}
|
||||||
|
|
Loading…
Reference in a new issue