Add more specs
This commit is contained in:
parent
607493ccda
commit
9430bba2e1
|
@ -9,6 +9,7 @@ Feature: Password change
|
||||||
| Текущий пароль | password |
|
| Текущий пароль | password |
|
||||||
And I click the form button "Обновить"
|
And I click the form button "Обновить"
|
||||||
Then the password is successfully changed
|
Then the password is successfully changed
|
||||||
|
And I received password change email as "user@example.com"
|
||||||
|
|
||||||
When I try to sign out
|
When I try to sign out
|
||||||
Then I am successfully signed out
|
Then I am successfully signed out
|
||||||
|
|
|
@ -107,6 +107,18 @@ Then 'I received confirmation email as {string}' do |email|
|
||||||
TEXT
|
TEXT
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Then 'I received password change email as {string}' do |email|
|
||||||
|
mail = ActionMailer::Base.deliveries.last
|
||||||
|
|
||||||
|
expect(mail.from).to eq %w[no-reply@libertarian-party.com]
|
||||||
|
expect(mail.to).to eq [email]
|
||||||
|
expect(mail.subject).to eq 'Пароль изменен'
|
||||||
|
expect(mail.body.to_s.split.join(' ')).to eq <<~TEXT.split("\n").join(' ')
|
||||||
|
<p>Приветствуем, #{email}!</p>
|
||||||
|
<p>Мы пытаемся связаться с вами, что бы сообщить, что ваш пароль был изменен.</p>
|
||||||
|
TEXT
|
||||||
|
end
|
||||||
|
|
||||||
Then 'I see that my email is confirmed' do
|
Then 'I see that my email is confirmed' do
|
||||||
expect(page.current_path).to eq '/users/sign_in'
|
expect(page.current_path).to eq '/users/sign_in'
|
||||||
expect(page).to have_css 'div.alert.alert-info',
|
expect(page).to have_css 'div.alert.alert-info',
|
||||||
|
|
Reference in New Issue