diff --git a/spec/models/status_message_spec.rb b/spec/models/status_message_spec.rb index 8202c021bb8db245951b6fa72dc7791e1195c9d4..300d8b858ac91d93de5dadfd5c1a6dffc064f330 100644 --- a/spec/models/status_message_spec.rb +++ b/spec/models/status_message_spec.rb @@ -226,6 +226,18 @@ STR end end + describe "#nsfw?" do + it 'returns MatchObject (true) if the post contains #nsfw (however capitalised)' do + status = Factory(:status_message, :text => "This message is #nSFw") + status.nsfw?.should be_true + end + + it 'returns nil (false) if the post does not contain #nsfw' do + status = Factory(:status_message, :text => "This message is #sFW") + status.nsfw?.should be_false + end + end + describe "#notify_person" do it 'notifies the person mentioned' do Notification.should_receive(:notify).with(alice, anything, anything)