From 1f98e1c639a5f1f91329e32c00a2967db692e906 Mon Sep 17 00:00:00 2001 From: Florian Staudacher Date: Sat, 22 Feb 2014 14:01:49 +0100 Subject: [PATCH] cleanup 'getting started' cukes a bit --- features/desktop/signs_up.feature | 2 +- features/mobile/getting_started.feature | 3 +-- features/step_definitions/session_steps.rb | 4 ++++ features/support/user_cuke_helpers.rb | 14 ++++++++++++-- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/features/desktop/signs_up.feature b/features/desktop/signs_up.feature index 606fee713..93a07470d 100644 --- a/features/desktop/signs_up.feature +++ b/features/desktop/signs_up.feature @@ -6,7 +6,7 @@ Feature: new user registration And I fill in the new user form And I press "Continue" Then I should be on the getting started page - And I should see "Well, hello there!" and "Who are you?" and "What are you into?" + Then I should see the 'getting started' contents Scenario: new user goes through the setup wizard When I fill in the following: diff --git a/features/mobile/getting_started.feature b/features/mobile/getting_started.feature index 7dc61e204..ad0bedd57 100644 --- a/features/mobile/getting_started.feature +++ b/features/mobile/getting_started.feature @@ -6,8 +6,7 @@ Feature: editing the gettig started in the mobile view And I fill in the new user form And I press "Continue" And I visit the mobile getting started page - And I should see "Well, hello there!" and "Who are you?" and "What are you into?" - And I should see "amparito" + Then I should see the 'getting started' contents When I attach the file "spec/fixtures/bad_urls.txt" to "file" within "#file-upload" And I confirm the alert diff --git a/features/step_definitions/session_steps.rb b/features/step_definitions/session_steps.rb index 67921bc0a..1679e4506 100644 --- a/features/step_definitions/session_steps.rb +++ b/features/step_definitions/session_steps.rb @@ -62,3 +62,7 @@ end Then(/^I should not be able to sign up$/) do confirm_not_signed_up end + +Then (/^I should see the 'getting started' contents$/) do + confirm_getting_started_contents +end diff --git a/features/support/user_cuke_helpers.rb b/features/support/user_cuke_helpers.rb index d22185b0a..497dcf87a 100644 --- a/features/support/user_cuke_helpers.rb +++ b/features/support/user_cuke_helpers.rb @@ -60,8 +60,9 @@ module UserCukeHelpers end def fill_in_new_user_form - fill_in('user_username', with: 'ohai') - fill_in('user_email', with: 'ohai@example.com') + @username = "ohai" + fill_in('user_username', with: @username) + fill_in('user_email', with: "#{@username}@example.com") fill_in('user_password', with: 'secret') fill_in('user_password_confirmation', with: 'secret') @@ -102,6 +103,15 @@ module UserCukeHelpers confirm_on_page('the new user registration page') confirm_form_validation_error('form#new_user') end + + def confirm_getting_started_contents + page.should have_content("Well, hello there!") + page.should have_content("Who are you?") + page.should have_content("What are you into?") + + # the username that was just entered for registration + page.should have_content(@username) + end end World(UserCukeHelpers)