aboutsummaryrefslogtreecommitdiffstats
path: root/spec/models/info_request_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/info_request_spec.rb')
-rw-r--r--spec/models/info_request_spec.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/models/info_request_spec.rb b/spec/models/info_request_spec.rb
index 70947584b..d8c0c59b1 100644
--- a/spec/models/info_request_spec.rb
+++ b/spec/models/info_request_spec.rb
@@ -1221,6 +1221,7 @@ describe InfoRequest do
describe InfoRequest, "when constructing a list of requests by query" do
before(:each) do
+ load_raw_emails_data
get_fixtures_xapian_index
end
@@ -1313,4 +1314,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