1
0
Fork 0

Add scenario to feature "Password change"

This commit is contained in:
Alex Kotov 2018-12-14 04:17:03 +05:00
parent a81152ab80
commit 82c520f311
No known key found for this signature in database
GPG key ID: 4E831250F47DE154
2 changed files with 29 additions and 1 deletions

View file

@ -1,6 +1,8 @@
Feature: Password change
Scenario: with valid credentials
Background:
Given I am signed in with email "user@example.com" and password "password"
Scenario: with valid credentials
When I visit "/users/edit"
And I fill form with the following data:
| key | value |
@ -19,3 +21,22 @@ Feature: Password change
When I try to sign in with email "user@example.com" and password "q1w2e3r4"
Then I am signed in as "user@example.com"
Scenario: with invalid password
When I visit "/users/edit"
And I fill form with the following data:
| key | value |
| Пароль | q1w2e3r4 |
| Подтверждение пароля | q1w2e3r4 |
| Текущий пароль | invalid |
And I click the form button "Обновить"
Then the password is failed to change
When I try to sign out
Then I am successfully signed out
When I try to sign in with email "user@example.com" and password "q1w2e3r4"
Then I fail to sign in
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

@ -107,3 +107,10 @@ Then 'the password is successfully changed' do
expect(page).to have_css 'div.alert.alert-info',
text: 'Ваша учетная запись изменена.'
end
Then 'the password is failed to change' do
expect(page.current_path).to eq '/users'
expect(page).to have_css 'div.alert.alert-danger',
text: 'Пожалуйста, исправьте следующие ошибки:'
expect(page).to have_text 'Текущий пароль имеет неверное значение'
end