From 63b20603a6d1366361aad96d8f9ba29d357c17cb Mon Sep 17 00:00:00 2001 From: Alex Kotov Date: Thu, 13 Dec 2018 01:00:16 +0500 Subject: [PATCH] Improve features --- features/main_page.feature | 2 +- features/sign_in.feature | 2 +- features/sign_up.feature | 2 +- features/step_definitions/stepdefs.rb | 7 ++----- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/features/main_page.feature b/features/main_page.feature index 7b294a2..ef92408 100644 --- a/features/main_page.feature +++ b/features/main_page.feature @@ -3,4 +3,4 @@ Feature: Main page Given I visit "/" Scenario: It works - Then I see main page + Then I see CSS "h1" with text "Либертарианская партия России" diff --git a/features/sign_in.feature b/features/sign_in.feature index 8c6087c..3c1a5fd 100644 --- a/features/sign_in.feature +++ b/features/sign_in.feature @@ -9,5 +9,5 @@ Feature: Sign in | Email | user@example.com | | Пароль | q1w2e3r4t5y6 | And I click the form button "Войти" - Then I see main page + Then I see CSS "h1" with text "Либертарианская партия России" And I am logged in as "user@example.com" diff --git a/features/sign_up.feature b/features/sign_up.feature index e56a6d7..f723987 100644 --- a/features/sign_up.feature +++ b/features/sign_up.feature @@ -9,4 +9,4 @@ Feature: Sign up | Пароль | q1w2e3r4t5y6 | | Подтверждение пароля | q1w2e3r4t5y6 | And I click the form button "Регистрация" - Then I see main page + Then I see CSS "h1" with text "Либертарианская партия России" diff --git a/features/step_definitions/stepdefs.rb b/features/step_definitions/stepdefs.rb index 94896ab..846995a 100644 --- a/features/step_definitions/stepdefs.rb +++ b/features/step_definitions/stepdefs.rb @@ -40,11 +40,8 @@ Then 'I see text {string}' do |text| expect(page).to have_content text end -Then 'I see main page' do - expect(page).to have_css( - 'h1', - text: I18n.translate('title'), - ) +Then 'I see CSS {string} with text {string}' do |selector, text| + expect(page).to have_css selector, text: text end Given 'I want to create the following passport:' do |table|