Refactor reshare feature

This commit is contained in:
Sarah Mei 2011-09-05 16:28:33 -07:00
parent 4ac6bd7d85
commit 862fc15910

View file

@ -2,31 +2,31 @@
Feature: public repost Feature: public repost
In order to make Diaspora more viral In order to make Diaspora more viral
As a User As a User
I want to reshare my friends post I want to reshare my friend's post
Background: Background:
Given a user named "Bob Jones" with email "bob@bob.bob" Given a user named "Bob Jones" with email "bob@bob.bob"
And a user named "Alice Smith" with email "alice@alice.alice" And a user named "Alice Smith" with email "alice@alice.alice"
And a user with email "bob@bob.bob" is connected with "alice@alice.alice" And a user with email "bob@bob.bob" is connected with "alice@alice.alice"
Scenario: I don't see the reshare button on my own posts
Scenario: does not show the reshare button on my own posts Given "bob@bob.bob" has a public post with text "reshare this!"
And "bob@bob.bob" has a non public post with text "reshare this!" And "bob@bob.bob" has a non public post with text "but don't reshare this."
And I sign in as "bob@bob.bob" And I sign in as "bob@bob.bob"
Then I should not see "Reshare" Then I should not see "Reshare"
Scenario: does not show a reshare button on other private pots Scenario: I don't see the reshare button on other people's private pots
And "bob@bob.bob" has a non public post with text "reshare this!" Given "bob@bob.bob" has a non public post with text "don't reshare this."
And I sign in as "alice@alice.alice" And I sign in as "alice@alice.alice"
Then I should not see "Reshare" Then I should not see "Reshare"
Scenario: does shows the reshare button on my own posts Scenario: I see the reshare button on my contact's public posts
And "bob@bob.bob" has a public post with text "reshare this!" Given "bob@bob.bob" has a public post with text "reshare this!"
And I sign in as "alice@alice.alice" And I sign in as "alice@alice.alice"
Then I should see "Reshare" Then I should see "Reshare"
Scenario: shows up on the profile page Scenario: When I reshare, it shows up on my profile page
And "bob@bob.bob" has a public post with text "reshare this!" Given "bob@bob.bob" has a public post with text "reshare this!"
And I sign in as "alice@alice.alice" And I sign in as "alice@alice.alice"
And I preemptively confirm the alert And I preemptively confirm the alert
@ -34,13 +34,13 @@ Feature: public repost
And I wait for the ajax to finish And I wait for the ajax to finish
And I wait for 2 seconds And I wait for 2 seconds
And I am on "alice@alice.alice"'s page When I am on "alice@alice.alice"'s page
Then I should see "reshare this!" Then I should see "reshare this!"
Then I should see a ".reshare" Then I should see a ".reshare"
And I should see "Bob" And I should see "Bob"
Scenario: shows up on the aspects page Scenario: When I reshare, it shows up in my stream
And "bob@bob.bob" has a public post with text "reshare this!" Given "bob@bob.bob" has a public post with text "reshare this!"
And I sign in as "alice@alice.alice" And I sign in as "alice@alice.alice"
And I preemptively confirm the alert And I preemptively confirm the alert
And I follow "Reshare" And I follow "Reshare"
@ -53,8 +53,8 @@ Feature: public repost
Then I should see a ".reshare" Then I should see a ".reshare"
And I should see "Bob" And I should see "Bob"
Scenario: can be retracted Scenario: I can delete a post that has been reshared
And "bob@bob.bob" has a public post with text "reshare this!" Given "bob@bob.bob" has a public post with text "reshare this!"
And I sign in as "alice@alice.alice" And I sign in as "alice@alice.alice"
And I preemptively confirm the alert And I preemptively confirm the alert
And I follow "Reshare" And I follow "Reshare"
@ -62,37 +62,34 @@ Feature: public repost
And I go to the home page And I go to the home page
Then I should see a ".reshare" Then I should see a ".reshare"
And I follow "Your Aspects"
When I follow "Your Aspects"
Then I should see "reshare this!" Then I should see "reshare this!"
Then I should see a ".reshare" Then I should see a ".reshare"
And I should see "Bob" And I should see "Bob"
And I go to the destroy user session page When I go to the destroy user session page
And I sign in as "bob@bob.bob" And I sign in as "bob@bob.bob"
And The user deletes their first post And The user deletes their first post
And I go to the destroy user session page And I go to the destroy user session page
And I sign in as "alice@alice.alice" And I sign in as "alice@alice.alice"
And I go to the home page When I go to the home page
Then I should see "Original post deleted by author" Then I should see "Original post deleted by author"
Scenario: Keeps track of the number of reshares Scenario: I can see the number of reshares
And "bob@bob.bob" has a public post with text "reshare this!" Given "bob@bob.bob" has a public post with text "reshare this!"
And I sign in as "alice@alice.alice" And I sign in as "alice@alice.alice"
And I preemptively confirm the alert And I preemptively confirm the alert
And I follow "Reshare" And I follow "Reshare"
And I wait for the ajax to finish And I wait for the ajax to finish
And I go to the home page When I go to the home page
Then I should see a ".reshare" Then I should see a ".reshare"
And I follow "Your Aspects" When I follow "Your Aspects"
Then I should see "reshare this!" Then I should see "reshare this!"
Then I should see a ".reshare" And I should see a ".reshare"
And I should see "Bob" And I should see "Bob"
And I go to the home page
And I should see "1 reshare" When I go to the home page
Then I should see "1 reshare"
Scenario: Can have text