[Fix #1209] test that en_construction is set for initiated mail
This commit is contained in:
parent
ca642abda8
commit
fcb8fb5935
1 changed files with 14 additions and 0 deletions
|
@ -125,6 +125,20 @@ shared_examples 'description_controller_spec' do
|
|||
|
||||
expect(dossier.state).to eq('en_construction')
|
||||
end
|
||||
|
||||
context 'sending the accusé de réception mail' do
|
||||
before { Timecop.freeze(DateTime.now) }
|
||||
|
||||
after { Timecop.return }
|
||||
|
||||
it 'sets the state of the dossier before sending the mail' do
|
||||
expect_any_instance_of(Mails::InitiatedMail)
|
||||
.to receive(:subject_for_dossier)
|
||||
.with(have_attributes(en_construction_at: DateTime.now))
|
||||
|
||||
submit_dossier
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context 'when user saves a brouillon' do
|
||||
|
|
Loading…
Reference in a new issue