Skip to content
Extraits de code Groupes Projets
Valider 605b418d rédigé par Steven Hancock's avatar Steven Hancock
Parcourir les fichiers

Reshares delegate nsfw to the root post

fixes #3120
parent 00123c0a
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -61,6 +61,10 @@ class Reshare < Post ...@@ -61,6 +61,10 @@ class Reshare < Post
Notifications::Reshared if root.author == user.person Notifications::Reshared if root.author == user.person
end end
def nsfw
root.nsfw
end
private private
def after_parse def after_parse
......
...@@ -41,3 +41,18 @@ Scenario: Toggling nsfw state ...@@ -41,3 +41,18 @@ Scenario: Toggling nsfw state
When I toggle nsfw posts When I toggle nsfw posts
Then I should not see "I love 0bj3ction4bl3 c0nt3nt!" Then I should not see "I love 0bj3ction4bl3 c0nt3nt!"
And I should not see "Sexy Senators Gone Wild!" And I should not see "Sexy Senators Gone Wild!"
Scenario: Resharing an 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"
And "tommy@pr0nking.com" has a public post with text "Sexy Senators Gone Wild!"
And I sign in as "laura@officeworkers.com"
And I toggle nsfw posts
And I preemptively confirm the alert
And I follow "Reshare"
And I wait for the ajax to finish
And I follow "Stream"
And I wait for the ajax to finish
Then I should have 2 nsfw posts
And I should not see "Sexy Senators Gone Wild!"
...@@ -53,6 +53,20 @@ describe Reshare do ...@@ -53,6 +53,20 @@ describe Reshare do
end end
end end
describe '#nsfw' do
before do
sfw = Factory(:status_message, :author => alice.person, :public => true)
nsfw = Factory(:status_message, :author => alice.person, :public => true, :text => "This is #nsfw")
@sfw_reshare = Factory(:reshare, :root => sfw)
@nsfw_reshare = Factory(:reshare, :root => nsfw)
end
it 'deletates #nsfw to the root post' do
@sfw_reshare.nsfw.should_not be_true
@nsfw_reshare.nsfw.should be_true
end
end
describe '#notification_type' do describe '#notification_type' do
before do before do
sm = Factory(:status_message, :author => alice.person, :public => true) sm = Factory(:status_message, :author => alice.person, :public => true)
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter