Skip to content
Extraits de code Groupes Projets
Valider a72a09a2 rédigé par Dennis Collinson's avatar Dennis Collinson
Parcourir les fichiers

posts made by nsfw people are marked nsfw by default

parent 8ae18bb3
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -66,7 +66,7 @@ describe StatusMessage do ...@@ -66,7 +66,7 @@ describe StatusMessage do
end end
end end
describe ".guids_for_author" do describe ".guids_for_author" do
it 'returns an array of the status_message guids' do it 'returns an array of the status_message guids' do
sm1 = Factory(:status_message, :author => alice.person) sm1 = Factory(:status_message, :author => alice.person)
sm2 = Factory(:status_message, :author => bob.person) sm2 = Factory(:status_message, :author => bob.person)
...@@ -226,15 +226,15 @@ STR ...@@ -226,15 +226,15 @@ STR
end end
end end
describe "#nsfw?" do describe "#nsfw" do
it 'returns MatchObject (true) if the post contains #nsfw (however capitalised)' do it 'returns MatchObject (true) if the post contains #nsfw (however capitalised)' do
status = Factory(:status_message, :text => "This message is #nSFw") status = Factory(:status_message, :text => "This message is #nSFw")
status.nsfw?.should be_true status.nsfw.should be_true
end end
it 'returns nil (false) if the post does not contain #nsfw' do it 'returns nil (false) if the post does not contain #nsfw' do
status = Factory(:status_message, :text => "This message is #sFW") status = Factory(:status_message, :text => "This message is #sFW")
status.nsfw?.should be_false status.nsfw.should be_false
end end
end end
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter