Added test for nsfw?
This commit is contained in:
parent
b792a6d3e0
commit
6571ec2fa9
1 changed files with 12 additions and 0 deletions
|
|
@ -226,6 +226,18 @@ STR
|
||||||
end
|
end
|
||||||
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
|
describe "#notify_person" do
|
||||||
it 'notifies the person mentioned' do
|
it 'notifies the person mentioned' do
|
||||||
Notification.should_receive(:notify).with(alice, anything, anything)
|
Notification.should_receive(:notify).with(alice, anything, anything)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue