Add more specs
This commit is contained in:
parent
52b89004fb
commit
300e213258
2 changed files with 17 additions and 0 deletions
|
@ -14,3 +14,9 @@ Feature: Sign up
|
||||||
|
|
||||||
When I try to sign in with email "user@example.com" and password "password"
|
When I try to sign in with email "user@example.com" and password "password"
|
||||||
Then I fail to sign in because of unconfirmed email
|
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"
|
||||||
|
|
|
@ -33,3 +33,14 @@ Then 'I fail to sign in because of unconfirmed email' do
|
||||||
expect(page).to have_css 'div.alert.alert-warning',
|
expect(page).to have_css 'div.alert.alert-warning',
|
||||||
text: 'Вы должны подтвердить вашу учетную запись.'
|
text: 'Вы должны подтвердить вашу учетную запись.'
|
||||||
end
|
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
|
||||||
|
|
Reference in a new issue