aboutsummaryrefslogtreecommitdiffstats
path: root/spec/controllers/general_controller_spec.rb
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2014-12-22 10:56:00 +0000
committerLouise Crow <louise.crow@gmail.com>2014-12-22 16:26:17 +0000
commite0f4e4dea6475c56382047f95ec4fad3fea3f6c3 (patch)
treed487fce12c38d6bbe1a2c8e34740691791fd9cee /spec/controllers/general_controller_spec.rb
parent70e466aad42a94d8e2b024e543eaaf7f4eec336a (diff)
Sanitize the blog contents
Diffstat (limited to 'spec/controllers/general_controller_spec.rb')
-rw-r--r--spec/controllers/general_controller_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/controllers/general_controller_spec.rb b/spec/controllers/general_controller_spec.rb
index c0a9d57d3..cb00b301c 100644
--- a/spec/controllers/general_controller_spec.rb
+++ b/spec/controllers/general_controller_spec.rb
@@ -53,6 +53,18 @@ describe GeneralController, 'when getting the blog feed' do
end
end
+ context 'when the blog has entries' do
+
+ render_views
+
+ it 'should escape any javascript from the entries' do
+ controller.stub!(:quietly_try_to_open).and_return(load_file_fixture("blog_feed.atom"))
+ get :blog
+ response.body.should_not include('<script>alert("exciting!")</script>')
+ end
+
+ end
+
end
describe GeneralController, "when showing the frontpage" do