diff --git a/features/sign_up.feature b/features/sign_up.feature new file mode 100644 index 0000000..1374bf9 --- /dev/null +++ b/features/sign_up.feature @@ -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 diff --git a/features/step_definitions/stepdefs.rb b/features/step_definitions/stepdefs.rb index 8817361..04309a0 100644 --- a/features/step_definitions/stepdefs.rb +++ b/features/step_definitions/stepdefs.rb @@ -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',