Properly format JSON for reshares to hide 'reshare' button on already reshared posts
closes #7169 fixes #4816 and #6594
This commit is contained in:
parent
e3b3da404f
commit
951149dd24
3 changed files with 21 additions and 6 deletions
|
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
## Bug fixes
|
## Bug fixes
|
||||||
* Fix fetching comments after fetching likes [#7167](https://github.com/diaspora/diaspora/pull/7167)
|
* Fix fetching comments after fetching likes [#7167](https://github.com/diaspora/diaspora/pull/7167)
|
||||||
|
* Hide 'reshare' button on already reshared posts [#7169](https://github.com/diaspora/diaspora/pull/7169)
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,7 @@ class PostPresenter < BasePresenter
|
||||||
end
|
end
|
||||||
|
|
||||||
def user_reshare
|
def user_reshare
|
||||||
@post.reshare_for(current_user)
|
@post.reshare_for(current_user).try(:as_api_response, :backbone)
|
||||||
end
|
end
|
||||||
|
|
||||||
def already_participated_in_poll
|
def already_participated_in_poll
|
||||||
|
|
|
||||||
|
|
@ -42,11 +42,25 @@ Feature: public repost
|
||||||
And I sign in as "bob@bob.bob"
|
And I sign in as "bob@bob.bob"
|
||||||
Then I should see "Original post deleted by author" within ".reshare"
|
Then I should see "Original post deleted by author" within ".reshare"
|
||||||
|
|
||||||
# should be covered in rspec, so testing that the post is added to
|
Scenario: Reshare a post from the stream
|
||||||
# app.stream in jasmine should be enough coverage
|
When I sign in as "alice@alice.alice"
|
||||||
Scenario: When I reshare, it shows up on my profile page
|
Then I should see a ".reshare" within ".feedback"
|
||||||
Given I sign in as "alice@alice.alice"
|
When I confirm the alert after I follow "Reshare"
|
||||||
And I confirm the alert after I follow "Reshare"
|
|
||||||
Then I should see a flash message indicating success
|
Then I should see a flash message indicating success
|
||||||
And I should see a flash message containing "successfully"
|
And I should see a flash message containing "successfully"
|
||||||
And I should not see a ".reshare" within ".feedback"
|
And I should not see a ".reshare" within ".feedback"
|
||||||
|
|
||||||
|
Scenario: Reshare a post from another user's profile
|
||||||
|
When I sign in as "alice@alice.alice"
|
||||||
|
And I am on "bob@bob.bob"'s page
|
||||||
|
Then I should see a ".reshare" within ".feedback"
|
||||||
|
When I confirm the alert after I follow "Reshare"
|
||||||
|
Then I should see a flash message indicating success
|
||||||
|
And I should see a flash message containing "successfully"
|
||||||
|
And I should not see a ".reshare" within ".feedback"
|
||||||
|
|
||||||
|
Scenario: Try to reshare an already reshared post from another user's profile
|
||||||
|
Given the post with text "reshare this!" is reshared by "alice@alice.alice"
|
||||||
|
When I sign in as "alice@alice.alice"
|
||||||
|
And I am on "bob@bob.bob"'s page
|
||||||
|
Then I should not see a ".reshare" within ".feedback"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue