aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Houston <robin.houston@gmail.com>2012-01-27 09:39:55 +0000
committerRobin Houston <robin.houston@gmail.com>2012-01-27 09:39:55 +0000
commit006eec6d272fb772559e66b525b649c305c9cc5d (patch)
tree0ca0018a10f51343e290a90da973a4131261325c
parent347a24ccfe0881b494044778cae64809d3e001c0 (diff)
clearing the test censor rules in an ensure block
Might as well be consistent about clearing the test censor rules in an ensure block. This would only mean that an exception in one test is less likely to cause unrelated failures in another.
-rw-r--r--spec/controllers/request_controller_spec.rb16
1 files changed, 9 insertions, 7 deletions
diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb
index ab8e35f71..bae1f32e7 100644
--- a/spec/controllers/request_controller_spec.rb
+++ b/spec/controllers/request_controller_spec.rb
@@ -353,14 +353,16 @@ describe RequestController, "when showing one request" do
censor_rule.last_edit_comment = "none"
ir.user.censor_rules << censor_rule
- receive_incoming_mail('incoming-request-two-same-name.email', ir.incoming_email)
- ir.reload
+ begin
+ receive_incoming_mail('incoming-request-two-same-name.email', ir.incoming_email)
+ ir.reload
- get :get_attachment, :incoming_message_id => ir.incoming_messages[1].id, :id => ir.id, :part => 2, :file_name => ['hello.txt'], :skip_cache => 1
- response.content_type.should == "text/plain"
- response.should have_text(/xxxxxx hello/)
-
- ir.user.censor_rules.clear
+ get :get_attachment, :incoming_message_id => ir.incoming_messages[1].id, :id => ir.id, :part => 2, :file_name => ['hello.txt'], :skip_cache => 1
+ response.content_type.should == "text/plain"
+ response.should have_text(/xxxxxx hello/)
+ ensure
+ ir.user.censor_rules.clear
+ end
end
it "should censor attachment names" do