aboutsummaryrefslogtreecommitdiffstats
path: root/spec/controllers/request_controller_spec.rb
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2015-01-07 09:53:18 +0000
committerLouise Crow <louise.crow@gmail.com>2015-01-07 09:53:18 +0000
commitb803759551cc036a5e043a2991f386d8bcd0a398 (patch)
tree61c6c01bc21802d17f7bebb90c3def451cd8d889 /spec/controllers/request_controller_spec.rb
parent76950510e850d7f09af9710d86bd94c815fd7759 (diff)
parentbe4f5819bd4b18ef0e241ee846d6b42fc7a36cbe (diff)
Merge branch 'hotfix/0.20.0.2' into rails-3-develop
Diffstat (limited to 'spec/controllers/request_controller_spec.rb')
-rw-r--r--spec/controllers/request_controller_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb
index 15e252501..2d3ccfa63 100644
--- a/spec/controllers/request_controller_spec.rb
+++ b/spec/controllers/request_controller_spec.rb
@@ -596,6 +596,18 @@ describe RequestController, "when showing one request" do
response.status.should == 303
end
+ it "should sanitise HTML attachments" do
+ incoming_message = FactoryGirl.create(:incoming_message_with_html_attachment)
+ get :get_attachment, :incoming_message_id => incoming_message.id,
+ :id => incoming_message.info_request.id,
+ :part => 2,
+ :file_name => 'interesting.html',
+ :skip_cache => 1
+ response.body.should_not match("script")
+ response.body.should_not match("interesting")
+ response.body.should match('dull')
+ end
+
it "should censor attachments downloaded as binary" do
ir = info_requests(:fancy_dog_request)