EQT instructeur, je peux supprimer un dossier terminé
This commit is contained in:
parent
f7f832bed8
commit
00b5ad7a10
18 changed files with 255 additions and 97 deletions
|
@ -743,16 +743,15 @@ describe Users::DossiersController, type: :controller do
|
|||
context 'when the user does not have any dossiers' do
|
||||
before { get(:index) }
|
||||
|
||||
it { expect(assigns(:current_tab)).to eq('mes-dossiers') }
|
||||
it { expect(assigns(:statut)).to eq('mes-dossiers') }
|
||||
end
|
||||
|
||||
context 'when the user only have its own dossiers' do
|
||||
let!(:own_dossier) { create(:dossier, user: user) }
|
||||
|
||||
before { get(:index) }
|
||||
|
||||
it { expect(assigns(:current_tab)).to eq('mes-dossiers') }
|
||||
it { expect(assigns(:dossiers)).to match([own_dossier]) }
|
||||
it { expect(assigns(:statut)).to eq('mes-dossiers') }
|
||||
it { expect(assigns(:user_dossiers)).to match([own_dossier]) }
|
||||
end
|
||||
|
||||
context 'when the user only have some dossiers invites' do
|
||||
|
@ -760,30 +759,30 @@ describe Users::DossiersController, type: :controller do
|
|||
|
||||
before { get(:index) }
|
||||
|
||||
it { expect(assigns(:current_tab)).to eq('dossiers-invites') }
|
||||
it { expect(assigns(:dossiers)).to match([invite.dossier]) }
|
||||
it { expect(assigns(:statut)).to eq('mes-dossiers') }
|
||||
it { expect(assigns(:dossiers_invites)).to match([invite.dossier]) }
|
||||
end
|
||||
|
||||
context 'when the user has both' do
|
||||
let!(:own_dossier) { create(:dossier, user: user) }
|
||||
let!(:invite) { create(:invite, dossier: create(:dossier), user: user) }
|
||||
|
||||
context 'and there is no current_tab param' do
|
||||
context 'and there is no statut param' do
|
||||
before { get(:index) }
|
||||
|
||||
it { expect(assigns(:current_tab)).to eq('mes-dossiers') }
|
||||
it { expect(assigns(:statut)).to eq('mes-dossiers') }
|
||||
end
|
||||
|
||||
context 'and there is "dossiers-invites" param' do
|
||||
before { get(:index, params: { current_tab: 'dossiers-invites' }) }
|
||||
before { get(:index, params: { statut: 'dossiers-invites' }) }
|
||||
|
||||
it { expect(assigns(:current_tab)).to eq('dossiers-invites') }
|
||||
it { expect(assigns(:statut)).to eq('dossiers-invites') }
|
||||
end
|
||||
|
||||
context 'and there is "mes-dossiers" param' do
|
||||
before { get(:index, params: { current_tab: 'mes-dossiers' }) }
|
||||
before { get(:index, params: { statut: 'mes-dossiers' }) }
|
||||
|
||||
it { expect(assigns(:current_tab)).to eq('mes-dossiers') }
|
||||
it { expect(assigns(:statut)).to eq('mes-dossiers') }
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue