2019-02-13 16:13:37 +01:00
|
|
|
describe Manager::DossiersController, type: :controller do
|
2020-03-25 18:08:32 +01:00
|
|
|
describe '#discard' do
|
2019-02-13 16:13:37 +01:00
|
|
|
let(:administration) { create :administration }
|
2020-03-25 18:08:32 +01:00
|
|
|
let(:dossier) { create(:dossier) }
|
2019-02-13 16:13:37 +01:00
|
|
|
|
|
|
|
before do
|
|
|
|
sign_in administration
|
2020-03-25 18:08:32 +01:00
|
|
|
post :discard, params: { id: dossier.id }
|
2019-02-13 16:13:37 +01:00
|
|
|
dossier.reload
|
|
|
|
end
|
|
|
|
|
2020-03-25 18:08:32 +01:00
|
|
|
it { expect(dossier.discarded?).to be_truthy }
|
2019-02-13 16:13:37 +01:00
|
|
|
end
|
2019-07-29 10:57:21 +02:00
|
|
|
|
|
|
|
describe '#repasser_en_instruction' do
|
|
|
|
let(:administration) { create :administration }
|
2020-03-25 18:08:32 +01:00
|
|
|
let(:dossier) { create(:dossier, :accepte) }
|
2019-07-29 10:57:21 +02:00
|
|
|
|
|
|
|
before do
|
|
|
|
sign_in administration
|
|
|
|
post :repasser_en_instruction, params: { id: dossier.id }
|
|
|
|
dossier.reload
|
|
|
|
end
|
|
|
|
|
2020-03-25 18:08:32 +01:00
|
|
|
it { expect(dossier.en_instruction?).to be_truthy }
|
2019-07-29 10:57:21 +02:00
|
|
|
end
|
2019-02-13 16:13:37 +01:00
|
|
|
end
|