Cleaning spec
This commit is contained in:
parent
e3d7688e66
commit
aeb44dd2aa
1 changed files with 5 additions and 7 deletions
|
@ -170,14 +170,14 @@ describe User, type: :model do
|
|||
let(:administrateur) { create(:administrateur) }
|
||||
let(:user) { administrateur.user }
|
||||
|
||||
let(:mailer_double) { double('mailer', deliver_later: true) }
|
||||
|
||||
before { allow(AdministrationMailer).to receive(:invite_admin).and_return(mailer_double) }
|
||||
|
||||
subject { user.invite_administrateur!(administration.id) }
|
||||
|
||||
context 'when the user is inactif' do
|
||||
before do
|
||||
mailer_double = double('mailer', deliver_later: true)
|
||||
allow(AdministrationMailer).to receive(:invite_admin).and_return(mailer_double)
|
||||
subject
|
||||
end
|
||||
before { subject }
|
||||
|
||||
it { expect(AdministrationMailer).to have_received(:invite_admin).with(user, kind_of(String), administration.id) }
|
||||
end
|
||||
|
@ -185,8 +185,6 @@ describe User, type: :model do
|
|||
context 'when the user is actif' do
|
||||
before do
|
||||
user.update(last_sign_in_at: Time.zone.now)
|
||||
mailer_double = double('mailer', deliver_later: true)
|
||||
allow(AdministrationMailer).to receive(:invite_admin).and_return(mailer_double)
|
||||
subject
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue