1
0
Fork 0

Add more specs

This commit is contained in:
Alex Kotov 2018-12-13 07:00:30 +05:00
parent 607493ccda
commit 9430bba2e1
No known key found for this signature in database
GPG Key ID: 4E831250F47DE154
2 changed files with 13 additions and 0 deletions

View File

@ -9,6 +9,7 @@ Feature: Password change
| Текущий пароль | password |
And I click the form button "Обновить"
Then the password is successfully changed
And I received password change email as "user@example.com"
When I try to sign out
Then I am successfully signed out

View File

@ -107,6 +107,18 @@ Then 'I received confirmation email as {string}' do |email|
TEXT
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
expect(page.current_path).to eq '/users/sign_in'
expect(page).to have_css 'div.alert.alert-info',