Merge pull request #1975 from TheLambdaCalculus/b1126-additional-refactoring
Added RSpec test for #1126
This commit is contained in:
commit
6be533b987
1 changed files with 15 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue