1
0
Fork 0

Add feature "Sign up"

This commit is contained in:
Alex Kotov 2018-12-01 04:22:10 +05:00
parent 7e9864e021
commit 7e41039609
No known key found for this signature in database
GPG Key ID: 4E831250F47DE154
2 changed files with 29 additions and 0 deletions

11
features/sign_up.feature Normal file
View File

@ -0,0 +1,11 @@
Feature: Sign up
Background:
Given I visit sign up page
Scenario:
When I fill form with the following data:
| Email | user@example.com |
| Пароль | q1w2e3r4t5y6 |
| Подтверждение пароля | q1w2e3r4t5y6 |
And I click the form button "Регистрация"
Then I see main page

View File

@ -4,6 +4,24 @@ When 'I visit main page' do
visit '/'
end
When 'I visit sign up page' do
visit '/users/sign_up'
end
When 'I fill form with the following data:' do |table|
within 'form' do
table.rows.each do |(key, value)|
fill_in key, with: value
end
end
end
When 'I click the form button {string}' do |string|
within 'form' do
click_on string
end
end
Then 'I see main page' do
expect(page).to have_css(
'h1',