From 8188816b1be4e3e2b2945c7cc2b579e5c4a11404 Mon Sep 17 00:00:00 2001 From: Sarah Mei Date: Mon, 5 Sep 2011 20:29:11 -0700 Subject: [PATCH] Remove more ordering assumptions - this time in the ordering of aspects in the dropdown. Are we there yet? --- features/connects_users.feature | 62 ++++++++++--------- features/notifications.feature | 2 +- features/step_definitions/custom_web_steps.rb | 4 ++ features/step_definitions/user_steps.rb | 4 +- features/stops_following_users.feature | 4 +- features/tags.feature | 2 +- 6 files changed, 43 insertions(+), 35 deletions(-) diff --git a/features/connects_users.feature b/features/connects_users.feature index 8467dd447..841642432 100644 --- a/features/connects_users.feature +++ b/features/connects_users.feature @@ -1,22 +1,21 @@ @javascript -Feature: sending and receiving requests +Feature: following and being followed Background: Given a user with email "bob@bob.bob" And a user with email "alice@alice.alice" + When I sign in as "bob@bob.bob" And I am on "alice@alice.alice"'s page + And I add the person to my "Besties" aspect - And I add the person to my 1st aspect - - And I am on the home page - Given I expand the publisher - When I fill in "status_message_fake_text" with "I am following you" + When I am on the home page + And I expand the publisher + And I fill in "status_message_fake_text" with "I am following you" And I press "Share" - Then I go to the destroy user session page - Scenario: see follower's posts on their profile page and not on the home page + Scenario: seeing a follower's posts on their profile page, but not in your stream When I sign in as "alice@alice.alice" And I am on "bob@bob.bob"'s page Then I should see "I am following you" @@ -24,7 +23,7 @@ Feature: sending and receiving requests And I am on the home page Then I should not see "I am following you" - Scenario: see following's public posts on their profile page and on the home page + Scenario: seeing public posts of someone you follow Given I sign in as "alice@alice.alice" And I am on the home page And I expand the publisher @@ -35,17 +34,17 @@ Feature: sending and receiving requests When I sign in as "bob@bob.bob" And I am on "alice@alice.alice"'s page - - Then I should see "I am ALICE" - And I am on the home page Then I should see "I am ALICE" - Scenario: mutual following the original follower should see private posts on their stream + When I am on the home page + Then I should see "I am ALICE" + + 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 1st aspect - And I add the person to my 2nd aspect + 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 When I follow "Your Aspects" @@ -53,20 +52,20 @@ Feature: sending and receiving requests Then I should have 1 contact in "Unicorns" Then I should have 1 contact in "Besties" - And I am on the home page - Given I expand the publisher + When I am on the home page + And I expand the publisher When I fill in "status_message_fake_text" with "I am following you back" And I press "Share" Then I go to the destroy user session page When I sign in as "bob@bob.bob" When I follow "Your Aspects" - Then I should have 1 contacts in "Besties" + Then I should have 1 contacts in "Besties" - And I am on the home page + When I am on the home page Then I should see "I am following you back" - Scenario: following a contact request into a new aspect + Scenario: adding someone who follows you while creating a new aspect When I sign in as "alice@alice.alice" And I am on "bob@bob.bob"'s page @@ -78,14 +77,14 @@ Feature: sending and receiving requests And I press "aspect_submit" in the modal window And I wait for the ajax to finish - When I go to the home page - Then I should have 1 contact in "Super People" - Then I go to the destroy user session page + When I go to the home page + Then I should have 1 contact in "Super People" + Then I go to the destroy user session page - When I sign in as "bob@bob.bob" - Then I should have 1 contact in "Besties" + When I sign in as "bob@bob.bob" + Then I should have 1 contact in "Besties" - Scenario: should not see "Add to aspect" and see mention if already a follower + Scenario: interacting with the profile page of someone you follow who is not following you When I sign in as "bob@bob.bob" And I am on "alice@alice.alice"'s page @@ -93,7 +92,7 @@ Feature: sending and receiving requests Then I should see "Mention" Then I should not see "Message" - Scenario: interacting with a follower's profile page + Scenario: interacting with the profile page of someone who follows you but who you do not follow Given I sign in as "alice@alice.alice" And I am on "bob@bob.bob"'s page @@ -101,10 +100,15 @@ Feature: sending and receiving requests And I should not see "Mention" And I should not see "Message" - When I add the person to my 1st aspect + Scenario: interacting with the profile page of someone you follow who also follows you + Given I sign in as "alice@alice.alice" + And I am on "bob@bob.bob"'s page + + When I add the person to my "Besties" aspect And I wait for the ajax to finish - And I add the person to my 2nd aspect + And I add the person to my "Unicorns" aspect And I wait for the ajax to finish + When I go to "bob@bob.bob"'s page Then I should see "All Aspects" And I should see "Mention" diff --git a/features/notifications.feature b/features/notifications.feature index 92610b588..5757215a6 100644 --- a/features/notifications.feature +++ b/features/notifications.feature @@ -12,7 +12,7 @@ Feature: Notifications Scenario: someone shares with me And I am on "alice@alice.alice"'s page - And I add the person to my 1st aspect + And I add the person to my "Besties" aspect And I go to the destroy user session page When I sign in as "alice@alice.alice" And I follow "notifications" in the header diff --git a/features/step_definitions/custom_web_steps.rb b/features/step_definitions/custom_web_steps.rb index 7d361770e..cbe75db81 100644 --- a/features/step_definitions/custom_web_steps.rb +++ b/features/step_definitions/custom_web_steps.rb @@ -73,6 +73,10 @@ And /^I click "([^"]*)" button$/ do |arg1| page.execute_script('$(".button:contains('+arg1+')").click()') end +And /^I click on selector "([^"]*)"$/ do |selector| + page.execute_script("$('#{selector}').click();") +end + And /^I preemptively confirm the alert$/ do page.evaluate_script("window.confirm = function() { return true; }") end diff --git a/features/step_definitions/user_steps.rb b/features/step_definitions/user_steps.rb index c7d9b793a..7b08a650a 100644 --- a/features/step_definitions/user_steps.rb +++ b/features/step_definitions/user_steps.rb @@ -98,10 +98,10 @@ Then /^I should have (\d) contacts? in "([^"]*)"$/ do |n_contacts, aspect_name| @me.aspects.where(:name => aspect_name).first.contacts.count.should == n_contacts.to_i end -When /^I (?:add|remove) the person (?:to|from) my (1st|2nd) aspect$/ do |aspect_ordinal| +When /^I (?:add|remove) the person (?:to|from) my "([^\"]*)" aspect$/ do |aspect_name| steps %Q{ And I press the first ".toggle.button" - And I press the #{aspect_ordinal} "li" within ".dropdown.active .dropdown_list" + And I click on selector ".dropdown.active .dropdown_list li[data-aspect_id=#{@me.aspects.where(:name => aspect_name).first.id}]" And I press the first ".toggle.button" } end diff --git a/features/stops_following_users.feature b/features/stops_following_users.feature index 1390e1cf5..256868876 100644 --- a/features/stops_following_users.feature +++ b/features/stops_following_users.feature @@ -9,12 +9,12 @@ Feature: Unfollowing And a user with email "alice@alice.alice" When I sign in as "bob@bob.bob" And I am on "alice@alice.alice"'s page - And I add the person to my 1st aspect + And I add the person to my "Besties" aspect 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 1st aspect + And I remove the person from my "Besties" aspect And I am on the home page Then I should have 0 contacts in "Besties" diff --git a/features/tags.feature b/features/tags.feature index b365f32f4..b2470b57b 100644 --- a/features/tags.feature +++ b/features/tags.feature @@ -16,7 +16,7 @@ Feature: Interacting with tags When I search for "#rockstar" Then I should see "Add to aspect" - When I add the person to my 1st aspect + When I add the person to my "Besties" aspect When I search for "#rockstar" Then I should see "generic"