diff --git a/features/desktop/activity_stream.feature b/features/desktop/activity_stream.feature index 13dd28f27..d7ba1a2ae 100644 --- a/features/desktop/activity_stream.feature +++ b/features/desktop/activity_stream.feature @@ -4,9 +4,9 @@ Feature: The activity stream Given a user with username "bob" When I sign in as "bob@bob.bob" - And I post "A- I like turtles" - And I post "B- barack obama is your new bicycle" - And I post "C- barack obama is a square" + And I click the publisher and post "A- I like turtles" + And I click the publisher and post "B- barack obama is your new bicycle" + And I click the publisher and post "C- barack obama is a square" When I go to the activity stream page Then "C- barack obama is a square" should be post 1 diff --git a/features/desktop/connects_users.feature b/features/desktop/connects_users.feature index 7756ee74d..62c860e42 100644 --- a/features/desktop/connects_users.feature +++ b/features/desktop/connects_users.feature @@ -57,7 +57,7 @@ Feature: following and being followed Then I should have 1 contact in "Besties" When I am on the home page - And I post "I am following you back" + And I click the publisher and post "I am following you back" Then I sign out When I sign in as "bob@bob.bob" @@ -88,7 +88,7 @@ Feature: following and being followed And I am on "alice@alice.alice"'s page Then I should see "Besties" - Then I should see a "#mention_button" within "#profile" + Then I should see a "#mention_button" within "#profile" Then I should not see a "#message_button" within "#profile" Scenario: interacting with the profile page of someone who follows you but who you do not follow diff --git a/features/desktop/follows_tags.feature b/features/desktop/follows_tags.feature index f648f2834..f8cbb228d 100644 --- a/features/desktop/follows_tags.feature +++ b/features/desktop/follows_tags.feature @@ -19,7 +19,7 @@ Feature: posting Scenario: can post a message from the tag page Then I should see "#boss" within "#publisher" - And I post "#boss from the tag page" + And I click the publisher and post "#boss from the tag page" And I search for "#boss" Then I should see "#boss from the tag page" @@ -31,7 +31,7 @@ Feature: posting Scenario: see a tag that I am following and I post over there When I go to the home page And I follow "#boss" - And I post "#boss from the #boss tag page" + And I click the publisher and post "#boss from the #boss tag page" Then I should see "#boss from the #boss tag page" within "body" Scenario: can stop following a tag from the tag page diff --git a/features/desktop/not_safe_for_work.feature b/features/desktop/not_safe_for_work.feature index 241fb5f77..72bdbd1e4 100644 --- a/features/desktop/not_safe_for_work.feature +++ b/features/desktop/not_safe_for_work.feature @@ -22,8 +22,8 @@ Scenario: Toggling nsfw state And a user with email "laura@officeworkers.com" And a user with email "laura@officeworkers.com" is connected with "tommy@pr0nking.com" When I sign in as "tommy@pr0nking.com" - And I post "I love 0bj3ction4bl3 c0nt3nt!" - And I post "Sexy Senators Gone Wild!" + And I click the publisher and post "I love 0bj3ction4bl3 c0nt3nt!" + And I click the publisher and post "Sexy Senators Gone Wild!" Then I should have 2 nsfw posts #toggling global nsfw state @@ -33,16 +33,11 @@ Scenario: Toggling nsfw state When I toggle nsfw posts Then I should see "I love 0bj3ction4bl3 c0nt3nt!" and "Sexy Senators Gone Wild!" - #cookies - #When I refresh the page - #Then I should see "I love 0bj3ction4bl3 c0nt3nt!" - #And I should see "Sexy Senators Gone Wild!" - #hiding When I toggle nsfw posts Then I should not see "I love 0bj3ction4bl3 c0nt3nt!" and "Sexy Senators Gone Wild!" -Scenario: Resharing an nsfw post +Scenario: Resharing a nsfw post Given a nsfw user with email "tommy@pr0nking.com" And a user with email "laura@officeworkers.com" And a user with email "laura@officeworkers.com" is connected with "tommy@pr0nking.com" diff --git a/features/desktop/signs_up.feature b/features/desktop/signs_up.feature index 22ed067fb..5839d5cf9 100644 --- a/features/desktop/signs_up.feature +++ b/features/desktop/signs_up.feature @@ -51,24 +51,16 @@ Feature: new user registration And I fill in the following: | user_username | $%&(/&%$&/=)(/ | And I press "Continue" - - Then following fields should have validation errors: - | user_username | - | user_email | - | user_password | + Then I should see a flash message containing "Email can't be blank - Password can't be blank - Username is invalid." When I fill in the following: | user_username | valid_user | | user_email | this is not a valid email $%&/()( | And I press "Continue" - - Then following fields should have validation errors: - | user_email | - | user_password | + Then I should see a flash message containing "Email is invalid - Password can't be blank" When I fill in the following: | user_email | valid@email.com | | user_password | 1 | And I press "Continue" - Then following field should have validation error: - | user_password | + Then I should see a flash message containing "Password doesn't match confirmation - Password is too short (minimum is 6 characters)" diff --git a/features/desktop/tags_and_comments.feature b/features/desktop/tags_and_comments.feature index ea9f4f103..35111cc22 100644 --- a/features/desktop/tags_and_comments.feature +++ b/features/desktop/tags_and_comments.feature @@ -4,7 +4,7 @@ Feature: Issue #3382 The comments under postings are missing when using the #tag Background: Given a user named "Bob Jones" with email "bob@bob.bob" And I sign in as "bob@bob.bob" - When I post "This is a post with a #tag" + When I post a status with the text "This is a post with a #tag" And I am on the homepage Scenario: diff --git a/features/step_definitions/custom_web_steps.rb b/features/step_definitions/custom_web_steps.rb index 1844cc095..d1fe7ddf5 100644 --- a/features/step_definitions/custom_web_steps.rb +++ b/features/step_definitions/custom_web_steps.rb @@ -60,17 +60,6 @@ And /^I submit the form$/ do find("input[type='submit']").click end -Then /^the "([^"]*)" field should have a validation error$/ do |field| - find_field(field).has_xpath?(".//ancestor::div[contains(@class, 'control-group')]/div[contains(@class, 'field_with_errors')]") -end - - -Then /^following field[s]? should have validation error[s]?:$/ do |fields| - fields.raw.each do |field| - step %{the "#{field[0]}" field should have a validation error} - end -end - And /^I expand the publisher$/ do click_publisher end diff --git a/features/step_definitions/posts_steps.rb b/features/step_definitions/posts_steps.rb index 672b2eb8f..3b7a8e027 100644 --- a/features/step_definitions/posts_steps.rb +++ b/features/step_definitions/posts_steps.rb @@ -51,10 +51,6 @@ Then /^I should see "([^"]*)" as the first post in my stream$/ do |text| first_post_text.should include(text) end -When /^I post "([^"]*)"$/ do |text| - click_and_post(text) -end - When /^I click the publisher and post "([^"]*)"$/ do |text| click_and_post(text) end diff --git a/features/support/publishing_cuke_helpers.rb b/features/support/publishing_cuke_helpers.rb index fe3bb6a8e..b694a5f93 100644 --- a/features/support/publishing_cuke_helpers.rb +++ b/features/support/publishing_cuke_helpers.rb @@ -26,13 +26,13 @@ module PublishingCukeHelpers def first_post_collapsed? find(".stream_element .collapsible", match: :first).should have_css(".expander") - find(".stream_element .collapsible", match: :first).has_selector?(".collapsed") + page.should have_css(".stream_element .collapsible.collapsed", match: :first) end def first_post_expanded? - has_no_css?(".stream_element .expander", match: :first).should be_true - find(".stream_element .collapsible", match: :first).has_no_selector?(".collapsed") - find(".stream_element .collapsible", match: :first).has_selector?(".opened") + page.should have_no_css(".stream_element .expander", match: :first) + page.should have_no_css(".stream_element .collapsible.collapsed", match: :first) + page.should have_css(".stream_element .collapsible.opened", match: :first) end def first_post_text