diff options
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/info_request_batch_spec.rb | 2 | ||||
-rw-r--r-- | spec/models/info_request_spec.rb | 16 |
2 files changed, 17 insertions, 1 deletions
diff --git a/spec/models/info_request_batch_spec.rb b/spec/models/info_request_batch_spec.rb index 2881e7745..701422037 100644 --- a/spec/models/info_request_batch_spec.rb +++ b/spec/models/info_request_batch_spec.rb @@ -80,7 +80,7 @@ describe InfoRequestBatch, "when finding an existing batch" do end end -describe InfoRequestBatch, "when creating a batch", :focus => true do +describe InfoRequestBatch, "when creating a batch" do before do @title = 'A test title' diff --git a/spec/models/info_request_spec.rb b/spec/models/info_request_spec.rb index 70947584b..c8bd2c338 100644 --- a/spec/models/info_request_spec.rb +++ b/spec/models/info_request_spec.rb @@ -1313,4 +1313,20 @@ describe InfoRequest do end + + describe 'when destroying a message' do + + it 'can destroy a request with comments and censor rules' do + info_request = FactoryGirl.create(:info_request) + censor_rule = FactoryGirl.create(:censor_rule, :info_request => info_request) + comment = FactoryGirl.create(:comment, :info_request => info_request) + info_request.reload + info_request.fully_destroy + + InfoRequest.where(:id => info_request.id).should be_empty + CensorRule.where(:id => censor_rule.id).should be_empty + Comment.where(:id => comment.id).should be_empty + end + + end end |