add explanation to spec login
This commit is contained in:
parent
a226999382
commit
b1f11c0b0a
1 changed files with 14 additions and 4 deletions
|
@ -74,8 +74,13 @@ describe Users::RegistrationsController, type: :controller do
|
|||
|
||||
before { subject }
|
||||
|
||||
it { expect(response).to redirect_to(new_user_confirmation_path(user: { email: user[:email] })) }
|
||||
it { expect(UserMailer).to have_received(:new_account_warning) }
|
||||
it 'sends an email to the user, stating that the account already exists' do
|
||||
expect(UserMailer).to have_received(:new_account_warning)
|
||||
end
|
||||
|
||||
it 'avoids leaking information about the account existence, by redirecting to the same page than normal signup' do
|
||||
expect(response).to redirect_to(new_user_confirmation_path(user: { email: user[:email] }))
|
||||
end
|
||||
end
|
||||
|
||||
context 'and the user is not confirmed' do
|
||||
|
@ -86,8 +91,13 @@ describe Users::RegistrationsController, type: :controller do
|
|||
subject
|
||||
end
|
||||
|
||||
it { expect(response).to redirect_to(new_user_confirmation_path(user: { email: user[:email] })) }
|
||||
it { expect(UserMailer).not_to have_received(:new_account_warning) }
|
||||
it 'does not send a warning email' do
|
||||
expect(UserMailer).not_to have_received(:new_account_warning)
|
||||
end
|
||||
|
||||
it 'avoids leaking information about the account existence, by redirecting to the same page than normal signup' do
|
||||
expect(response).to redirect_to(new_user_confirmation_path(user: { email: user[:email] }))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue