From d40cbd0b2b63428b8392314cf1c0e8227ca803d9 Mon Sep 17 00:00:00 2001
From: Steffen van Bergerem <svbergerem@online.de>
Date: Mon, 16 Mar 2015 14:01:54 +0100
Subject: [PATCH] Remove unnecessary 'on the home page' steps

---
 features/desktop/blocks_user.feature          |  4 +--
 features/desktop/change_password.feature      |  2 +-
 features/desktop/connects_users.feature       | 23 ++++++----------
 features/desktop/donations.feature            |  4 +--
 features/desktop/keyboard_navigation.feature  | 11 +++-----
 features/desktop/likes.feature                | 11 +++-----
 features/desktop/manages_aspects.feature      |  4 ---
 features/desktop/mentions.feature             |  2 --
 .../mentions_from_profile_page.feature        |  8 +++---
 features/desktop/notifications.feature        |  4 +--
 features/desktop/oembed.feature               |  3 +--
 features/desktop/photo_lightbox.feature       | 10 +++----
 features/desktop/post_preview.feature         |  1 -
 features/desktop/post_with_a_poll.feature     |  7 +++--
 features/desktop/posts_from_main_page.feature |  6 ++---
 .../desktop/posts_from_profile_page.feature   | 13 +++++-----
 features/desktop/posts_from_tag_page.feature  | 10 +++----
 features/desktop/show_more.feature            |  6 +----
 .../single_post_view_moderation.feature       | 26 ++++++++-----------
 .../desktop/stops_following_users.feature     | 17 ++++--------
 20 files changed, 61 insertions(+), 111 deletions(-)

diff --git a/features/desktop/blocks_user.feature b/features/desktop/blocks_user.feature
index 84e2b66af4..b93bf28c89 100644
--- a/features/desktop/blocks_user.feature
+++ b/features/desktop/blocks_user.feature
@@ -9,12 +9,10 @@ Feature: Blocking a user from the stream
     And Alice has a post mentioning Bob
     And I sign in as "bob@bob.bob"
 
-
   Scenario: Blocking a user
-    When I am on the home page
     When I click on the first block button
     And I confirm the alert
-    And I am on the home page
+    And I go to the home page
     Then I should not see any posts in my stream
 
   Scenario: Blocking a user from the profile page
diff --git a/features/desktop/change_password.feature b/features/desktop/change_password.feature
index 2c62adba2f..4b20caa56b 100644
--- a/features/desktop/change_password.feature
+++ b/features/desktop/change_password.feature
@@ -50,4 +50,4 @@ Feature: Change password
     Given I am on forgot password page
     When I fill out forgot password form with "notanemail"
     And I submit forgot password form
-    Then I should see "No account with this email exists"   
+    Then I should see "No account with this email exists"
diff --git a/features/desktop/connects_users.feature b/features/desktop/connects_users.feature
index a5904a3cee..f73906ac92 100644
--- a/features/desktop/connects_users.feature
+++ b/features/desktop/connects_users.feature
@@ -18,7 +18,7 @@ Feature: following and being followed
     And I am on "bob@bob.bob"'s page
     Then I should see "I am following you"
 
-    And I am on the home page
+    When I go to the home page
     Then I should not see "I am following you"
 
   Scenario: seeing public posts of someone you follow
@@ -28,7 +28,7 @@ Feature: following and being followed
     And I am on "alice@alice.alice"'s page
     Then I should see "I am ALICE"
 
-    When I am on the home page
+    When I go to the home page
     Then I should see "I am ALICE"
 
   Scenario: I follow a malicious user
@@ -47,24 +47,17 @@ Feature: following and being followed
   Scenario: seeing non-public posts of someone you follow who also follows you
     When I sign in as "alice@alice.alice"
     And I am on "bob@bob.bob"'s page
-
     And I add the person to my "Besties" aspect
     And I add the person to my "Unicorns" aspect
-
-    When I go to the home page
-
+    And I go to the home page
     Then I should have 1 contact in "Unicorns"
-    Then I should have 1 contact in "Besties"
-
-    When I am on the home page
-    And I click the publisher and post "I am following you back"
-    Then I sign out
+    And I should have 1 contact in "Besties"
 
-    When I sign in as "bob@bob.bob"
+    When I click the publisher and post "I am following you back"
+    And I sign out
+    And I sign in as "bob@bob.bob"
     Then I should have 1 contacts in "Besties"
-
-    When I am on the home page
-    Then I should see "I am following you back"
+    And I should see "I am following you back"
 
   Scenario: adding someone who follows you while creating a new aspect
     When I sign in as "alice@alice.alice"
diff --git a/features/desktop/donations.feature b/features/desktop/donations.feature
index fbaa253d82..9bf0b28180 100644
--- a/features/desktop/donations.feature
+++ b/features/desktop/donations.feature
@@ -1,6 +1,6 @@
 @javascript
 Feature: donations
-  In order to accept donation 
+  In order to accept donation
   As a podmin
   I want a donation box shown on the stream page
 
@@ -12,5 +12,5 @@ Feature: donations
 
   Scenario: Bitcoin donations
     Given I have configured a Bitcoin address
-    And I am on the home page
+    And I go to the home page
     Then I should see the Bitcoin address
diff --git a/features/desktop/keyboard_navigation.feature b/features/desktop/keyboard_navigation.feature
index 384d7959b9..228b4ca055 100644
--- a/features/desktop/keyboard_navigation.feature
+++ b/features/desktop/keyboard_navigation.feature
@@ -9,8 +9,7 @@ Feature: Keyboard navigation
     And I sign in as "bob@bob.bob"
 
   Scenario: navigate downwards
-    When I am on the home page
-    And I press the "J" key somewhere
+    When I press the "J" key somewhere
     Then post 1 should be highlighted
     And I should have navigated to the highlighted post
 
@@ -24,15 +23,13 @@ Feature: Keyboard navigation
     And I close the publisher
 
   Scenario: navigate upwards
-    When I am on the home page
-    And I scroll to post 3
-    When I press the "K" key somewhere
+    When I scroll to post 3
+    And I press the "K" key somewhere
     Then post 2 should be highlighted
     And I should have navigated to the highlighted post
 
   Scenario: expand the comment form in the main stream
-    When I am on the home page
-    Then the first comment field should be closed
+    Given the first comment field should be closed
     When I press the "J" key somewhere
     And I press the "C" key somewhere
     Then the first comment field should be open
diff --git a/features/desktop/likes.feature b/features/desktop/likes.feature
index 1b5ce8bf1d..a961ff41ba 100644
--- a/features/desktop/likes.feature
+++ b/features/desktop/likes.feature
@@ -14,12 +14,9 @@ Feature: Liking posts
     And I sign in as "alice@alice.alice"
 
   Scenario: Liking and unliking a post from the stream
-    When I am on the home page
-    Then I should see "Bob"
-    And I should see "I like unicorns"
     When I like the post "I like unicorns" in the stream
     Then I should see a ".likes" within "#main_stream .stream_element"
-    
+
     When I unlike the post "I like unicorns" in the stream
     Then I should not see a ".likes" within "#main_stream .stream_element"
 
@@ -27,14 +24,12 @@ Feature: Liking posts
     When I open the show page of the "I like unicorns" post
     And I click to like the post
     Then I should see a ".count" within "#single-post-interactions"
-    
+
     When I click to unlike the post
     Then I should not see a ".count" within "#single-post-interactions"
 
   Scenario: Someone likes my post
-    When I am on the home page
-    And I like the post "I like unicorns" in the stream
+    When I like the post "I like unicorns" in the stream
     And I sign out
     And I sign in as "bob@bob.bob"
-    And I am on the home page
     Then I should see a ".likes" within "#main_stream .stream_element"
diff --git a/features/desktop/manages_aspects.feature b/features/desktop/manages_aspects.feature
index 09037da409..4eb10aadbd 100644
--- a/features/desktop/manages_aspects.feature
+++ b/features/desktop/manages_aspects.feature
@@ -65,8 +65,6 @@ Feature: User manages contacts
   Scenario: clicking on the contacts link in the header with zero contacts directs a user to the featured users page
     Given I am signed in
     And I have 0 contacts
-    And I am on the home page
-
     And I click on my name in the header
     When I follow "Contacts"
     Then I should see "Community spotlight" within ".span9"
@@ -74,8 +72,6 @@ Feature: User manages contacts
   Scenario: clicking on the contacts link in the header with contacts does not send a user to the featured users page
     Given I am signed in
     And I have 2 contacts
-    And I am on the home page
-
     And I click on my name in the header
     When I follow "Contacts"
     Then I should not see "Community spotlight" within ".span9"
diff --git a/features/desktop/mentions.feature b/features/desktop/mentions.feature
index 8e9433c45c..08e792ac77 100644
--- a/features/desktop/mentions.feature
+++ b/features/desktop/mentions.feature
@@ -12,7 +12,6 @@ Feature: Mentions
     And a user with email "bob@bob.bob" is connected with "alice@alice.alice"
     And Alice has a post mentioning Bob
     When I sign in as "alice@alice.alice"
-    And I am on the home page
     And I follow "Bob Jones"
     Then I should see "Bob Jones"
 
@@ -23,7 +22,6 @@ Feature: Mentions
       | Alice Smith  | alice@alice.alice |
     And a user with email "bob@bob.bob" is connected with "alice@alice.alice"
     When I sign in as "alice@alice.alice"
-    And I am on the home page
     And I expand the publisher
     When I fill in the following:
       | status_message_fake_text  | @Bo  |
diff --git a/features/desktop/mentions_from_profile_page.feature b/features/desktop/mentions_from_profile_page.feature
index d1e4490eab..f18812d05e 100644
--- a/features/desktop/mentions_from_profile_page.feature
+++ b/features/desktop/mentions_from_profile_page.feature
@@ -5,21 +5,19 @@ Feature: mentioning a contact from their profile page
     I want to mention someone more cool than the average bear
 
     Background:
-      Given I am on the home page
-      And following users exist:
+      Given following users exist:
         | username   |
         | bob        |
         | alice      |
 
-      When I sign in as "bob@bob.bob"
       And a user with username "bob" is connected with "alice"
+      And I sign in as "bob@bob.bob"
       And I have following aspects:
         | PostingTo            |
         | NotPostingThingsHere |
       And I have user with username "alice" in an aspect called "PostingTo"
       And I have user with username "alice" in an aspect called "NotPostingThingsHere"
-
-      And I am on the home page
+      And I go to the home page
 
     Scenario: mentioning while posting to all aspects
       Given I am on "alice@alice.alice"'s page
diff --git a/features/desktop/notifications.feature b/features/desktop/notifications.feature
index a94b23df72..8707dbf9b6 100644
--- a/features/desktop/notifications.feature
+++ b/features/desktop/notifications.feature
@@ -94,7 +94,7 @@ Feature: Notifications
     And I sign out
     When I sign in as "alice@alice.alice"
     And I follow "Notifications" in the header
-    And I active the first hovercard after loading the notifications page 
+    And I active the first hovercard after loading the notifications page
     When I press the aspect dropdown
     Then the aspect dropdown should be visible
 
@@ -117,4 +117,4 @@ Feature: Notifications
     When I scroll down on the notifications dropdown
     Then I should have scrolled down on the notification dropdown
     And I wait for notifications to load
-    Then there should be 15 notifications loaded
\ No newline at end of file
+    Then there should be 15 notifications loaded
diff --git a/features/desktop/oembed.feature b/features/desktop/oembed.feature
index 6742d4e44c..02625de32d 100644
--- a/features/desktop/oembed.feature
+++ b/features/desktop/oembed.feature
@@ -9,8 +9,7 @@ Feature: oembed
       | username    | email             |
       | Alice Smith | alice@alice.alice |
     And I have several oEmbed data in cache
-    When I sign in as "alice@alice.alice"
-    And I am on the home page
+    And I sign in as "alice@alice.alice"
 
   Scenario: Post a secure video link
     Given I expand the publisher
diff --git a/features/desktop/photo_lightbox.feature b/features/desktop/photo_lightbox.feature
index ba27fcd7c6..264280829d 100644
--- a/features/desktop/photo_lightbox.feature
+++ b/features/desktop/photo_lightbox.feature
@@ -1,13 +1,9 @@
 @javascript
 Feature: viewing the photo lightbox
   Background:
-    Given I am on the home page
-    And a user with username "bob"
-
-    When I sign in as "bob@bob.bob"
-    And I am on the home page
-
-    Given I expand the publisher
+    Given a user with username "bob"
+    And I sign in as "bob@bob.bob"
+    And I expand the publisher
     And I attach the file "spec/fixtures/button.png" to hidden "file" within "#file-upload"
     And I fill in the following:
         | status_message_fake_text    | Look at this dog    |
diff --git a/features/desktop/post_preview.feature b/features/desktop/post_preview.feature
index 34df1604a4..beb86a9740 100644
--- a/features/desktop/post_preview.feature
+++ b/features/desktop/post_preview.feature
@@ -11,7 +11,6 @@ Feature: preview posts in the stream
         | Alice Smith  | alice@alice.alice |
       And a user with email "bob@bob.bob" is connected with "alice@alice.alice"
       When I sign in as "bob@bob.bob"
-      And I am on the home page
       Then I should not see any posts in my stream
 
     Scenario: preview and post a text-only message
diff --git a/features/desktop/post_with_a_poll.feature b/features/desktop/post_with_a_poll.feature
index b6a34a9d32..954211df74 100644
--- a/features/desktop/post_with_a_poll.feature
+++ b/features/desktop/post_with_a_poll.feature
@@ -6,8 +6,7 @@ Feature: posting with a poll
         | username   |
         | bob        |
       And I sign in as "bob@bob.bob"
-      And I am on the home page
-      
+
     Scenario: expanding the publisher
       Given "#poll_creator_container" is hidden
       When I expand the publisher
@@ -24,7 +23,7 @@ Feature: posting with a poll
       When I expand the publisher
       And I click on selector "#poll_creator"
       And I fill in values for the first two options
-      And I lose focus 
+      And I lose focus
       Then I should see 3 options
 
     Scenario: delete an option
@@ -32,7 +31,7 @@ Feature: posting with a poll
       When I expand the publisher
       And I click on selector "#poll_creator"
       And I fill in values for the first two options
-      And I lose focus 
+      And I lose focus
       And I delete the last option
       Then I should see 2 option
       And I should not see a remove icon
diff --git a/features/desktop/posts_from_main_page.feature b/features/desktop/posts_from_main_page.feature
index 95c611521f..ce425b22d9 100644
--- a/features/desktop/posts_from_main_page.feature
+++ b/features/desktop/posts_from_main_page.feature
@@ -9,14 +9,14 @@ Feature: posting from the main page
         | username   |
         | bob        |
         | alice      |
-      And I sign in as "bob@bob.bob"
       And a user with username "bob" is connected with "alice"
-      Given I have following aspects:
+      And I sign in as "bob@bob.bob"
+      And I have following aspects:
         | PostingTo            |
         | NotPostingThingsHere |
       And I have user with username "alice" in an aspect called "PostingTo"
       And I have user with username "alice" in an aspect called "NotPostingThingsHere"
-      And I am on the home page
+      And I go to the home page
 
     Scenario: expanding the publisher
       Given ".markdownIndications" is hidden
diff --git a/features/desktop/posts_from_profile_page.feature b/features/desktop/posts_from_profile_page.feature
index 6eb9aeb99c..1f26e5fc18 100644
--- a/features/desktop/posts_from_profile_page.feature
+++ b/features/desktop/posts_from_profile_page.feature
@@ -4,13 +4,12 @@ Feature: posting from own profile page
     I want to post from my profile page
 
     Background:
-      Given I am on the home page
-      And a user with username "alice"
-      When I sign in as "alice@alice.alice"
-      Given I have following aspects:
+      Given a user with username "alice"
+      And I sign in as "alice@alice.alice"
+      And I have following aspects:
         | Family |
         | Work   |
-      Given I am on "alice@alice.alice"'s page
+      And I am on "alice@alice.alice"'s page
 
     Scenario: posting some text
       Given I expand the publisher
@@ -22,7 +21,7 @@ Feature: posting from own profile page
 
       Then I should see "I want to understand people"
 
-      When I am on the home page
+      When I go to the home page
       Then I should see "I want to understand people"
 
       When I am on the aspects page
@@ -39,7 +38,7 @@ Feature: posting from own profile page
       And I attach "spec/fixtures/button.png" to the publisher
       And I submit the publisher
 
-      When I am on the home page
+      When I go to the home page
       Then I should see a "img" within ".stream_element div.photo_attachments"
       And I should see "who am I?" within ".stream_element"
 
diff --git a/features/desktop/posts_from_tag_page.feature b/features/desktop/posts_from_tag_page.feature
index 6fa16f86c1..79ac320266 100644
--- a/features/desktop/posts_from_tag_page.feature
+++ b/features/desktop/posts_from_tag_page.feature
@@ -4,20 +4,18 @@ Feature: Posting from the tag page
   I want to post from the tag page
 
     Background:
-      Given I am on the home page
-      And a user with username "alice"
-      When I sign in as "alice@alice.alice"
+      Given a user with username "alice"
+      And I sign in as "alice@alice.alice"
       And I am on the tag page for "cats"
 
     Scenario: posting some text
-      Given I expand the publisher
+      When I expand the publisher
       And I have turned off jQuery effects
       And I append "I like cats." to the publisher
       And I press "Share"
-
       Then "#cats I like cats." should be post 1
 
-      When I am on the home page
+      When I go to the home page
       Then "#cats I like cats." should be post 1
 
       When I am on the tag page for "cats"
diff --git a/features/desktop/show_more.feature b/features/desktop/show_more.feature
index b8f9a6e2e0..b11b227866 100644
--- a/features/desktop/show_more.feature
+++ b/features/desktop/show_more.feature
@@ -1,6 +1,6 @@
 @javascript
 Feature: collapsing and expanding long posts
-    In order to tame the lengths of posts in my stream 
+    In order to tame the lengths of posts in my stream
     As a rocket scientist
     I want long posts to be collapsed and expand on click
 
@@ -9,18 +9,14 @@ Feature: collapsing and expanding long posts
         | username |
         | bob      |
       And I sign in as "bob@bob.bob"
-      And I am on the home page
 
     Scenario: post a very long message
       Given I post an extremely long status message
       And I go to the home page
-      
       Then the post should be collapsed
 
     Scenario: expand a very long message
       Given I post an extremely long status message
       And I go to the home page
       And I expand the post
-
       Then the post should be expanded
-      
diff --git a/features/desktop/single_post_view_moderation.feature b/features/desktop/single_post_view_moderation.feature
index 09f9405d7a..c47db4a48a 100644
--- a/features/desktop/single_post_view_moderation.feature
+++ b/features/desktop/single_post_view_moderation.feature
@@ -6,10 +6,9 @@
       | username   |
       | bob        |
       | alice      |
-    And I sign in as "bob@bob.bob"
     And a user with username "bob" is connected with "alice"
-    And I am on the home page
-  
+    And I sign in as "bob@bob.bob"
+
   Scenario: hide a contact's post
     Given I expand the publisher
     When I write the status message "Here is a post to test with"
@@ -17,13 +16,13 @@
 
     And I log out
     And I sign in as "alice@alice.alice"
-    
+
     And I open the show page of the "Here is a post to test with" post
     And I click to hide the post
     And I confirm the alert
-    
+
     Then I should be on the stream page
-  
+
   Scenario: block a contact
     Given I expand the publisher
     When I write the status message "Here is a post to test with"
@@ -31,13 +30,13 @@
 
     And I log out
     And I sign in as "alice@alice.alice"
-    
+
     And I open the show page of the "Here is a post to test with" post
     And I click to block the user
     And I confirm the alert
-    
+
     Then I should be on the stream page
-    
+
   Scenario: report a contact
     Given I expand the publisher
     When I write the status message "Here is a post to test with"
@@ -45,13 +44,13 @@
 
     And I log out
     And I sign in as "alice@alice.alice"
-    
+
     And I open the show page of the "Here is a post to test with" post
     And I click to report the post
     And I confirm the alert
-    
+
     And I should see a flash message containing "The report has successfully been created"
-    
+
   Scenario: delete own post
     Given I expand the publisher
     When I write the status message "Here is a post to test with"
@@ -60,7 +59,4 @@
     And I open the show page of the "Here is a post to test with" post
     And I click to delete the post
     And I confirm the alert
-    
     Then I should be on the stream page
-    
-    
\ No newline at end of file
diff --git a/features/desktop/stops_following_users.feature b/features/desktop/stops_following_users.feature
index cf9a7bdc96..9859b3b4bb 100644
--- a/features/desktop/stops_following_users.feature
+++ b/features/desktop/stops_following_users.feature
@@ -15,27 +15,20 @@ Feature: Unfollowing
 
   Scenario: stop following someone while on their profile page
     When I am on "alice@alice.alice"'s page
-
     And I remove the person from my "Besties" aspect
-    And I am on the home page
-
+    And I go to the home page
     Then I should have 0 contacts in "Besties"
 
-    Then I sign out
-    When I sign in as "alice@alice.alice"
+    When I sign out
+    And I sign in as "alice@alice.alice"
     And I am on "bob@bob.bob"'s page
-
     Then I should not see "is sharing with you."
 
   Scenario: stop following someone while on the contacts page
-    When I go to the home page
-    And I go to the contacts page
-
+    When I go to the contacts page
     And I follow "Besties"
-
     And I remove the first person from the aspect
-
-    When I follow "My contacts"
+    And I follow "My contacts"
     Then I should have 0 contacts in "Besties"
 
     When I sign out
-- 
GitLab