avoid phishing
This commit is contained in:
parent
0e7a6f5acf
commit
c7f7855f14
2 changed files with 23 additions and 1 deletions
|
@ -221,4 +221,22 @@ describe Users::SessionsController, type: :controller do
|
|||
it { is_expected.to be true }
|
||||
end
|
||||
end
|
||||
|
||||
describe '#link_sent' do
|
||||
render_views
|
||||
|
||||
before { get :link_sent, params: { email: link_email } }
|
||||
|
||||
context 'when the email is legit' do
|
||||
let(:link_email) { 'a@a.com' }
|
||||
|
||||
it { expect(response.body).to include(link_email) }
|
||||
end
|
||||
|
||||
context 'when the email is evil' do
|
||||
let(:link_email) { 'Hello, I am an evil email' }
|
||||
|
||||
it { expect(response).to redirect_to(root_path) }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue