1
0
Fork 0

Add more specs

This commit is contained in:
Alex Kotov 2018-12-13 06:32:57 +05:00
parent 52b89004fb
commit 300e213258
No known key found for this signature in database
GPG Key ID: 4E831250F47DE154
2 changed files with 17 additions and 0 deletions

View File

@ -14,3 +14,9 @@ Feature: Sign up
When I try to sign in with email "user@example.com" and password "password"
Then I fail to sign in because of unconfirmed email
When I follow confirmation link for email "user@example.com"
Then I see that my email is confirmed
When I try to sign in with email "user@example.com" and password "password"
Then I am signed in as "user@example.com"

View File

@ -33,3 +33,14 @@ Then 'I fail to sign in because of unconfirmed email' do
expect(page).to have_css 'div.alert.alert-warning',
text: 'Вы должны подтвердить вашу учетную запись.'
end
When 'I follow confirmation link for email {string}' do |email|
user = User.find_by! email: email
visit user_confirmation_path confirmation_token: user.confirmation_token
end
Then 'I see that my email is confirmed' do
expect(page.current_path).to eq '/users/sign_in'
expect(page).to have_css 'div.alert.alert-info',
text: 'Ваш адрес эл. почты успешно подтвержден.'
end