1
0
Fork 0

Add scenario to feature "Password change"

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

View file

@ -31,6 +31,7 @@ Feature: Password change
| Текущий пароль | invalid |
And I click the form button "Обновить"
Then the password is failed to change
And I see text "Текущий пароль имеет неверное значение"
When I try to sign out
Then I am successfully signed out
@ -40,3 +41,26 @@ Feature: Password change
When I try to sign in with email "user@example.com" and password "password"
Then I am signed in as "user@example.com"
Scenario: with invalid password confirmation
When I visit "/users/edit"
And I fill form with the following data:
| key | value |
| Пароль | q1w2e3r4 |
| Подтверждение пароля | invalid |
| Текущий пароль | password |
And I click the form button "Обновить"
Then the password is failed to change
And I see text "Подтверждение пароля не совпадает со значением поля Пароль"
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 "invalid"
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

@ -112,5 +112,4 @@ 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