Skip to content
Snippets Groups Projects
Commit 83fc972c authored by The Lambda Calculus's avatar The Lambda Calculus
Browse files

Added RSpec test for #1126

parent 4307de96
No related branches found
No related tags found
No related merge requests found
......@@ -200,5 +200,20 @@ describe Photo do
@status_message.destroy
}.should change(Photo, :count).by(-1)
end
it 'will delete parent status message iff message is otherwise empty' do
expect {
@photo2.destroy
}.should change(StatusMessage, :count).by(-1)
end
it 'will not delete parent status message iff message had other content' do
expect {
@status_message.text = "Some text"
@status_message.save
@status_message.reload
@photo2.destroy
}.should_not change(StatusMessage, :count)
end
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment