Hotfix: don't escape HTML for analytics script

This commit is contained in:
Skud committed 2013-03-29 10:25:28 +11:00
1 parent de39047781
commit da4a86bd2c
2 files changed
+4 -3

No files matched your search

+1 -1
View File
@@ -25,4 +25,4 @@
/ Placed at the end of the document so the pages load faster
= javascript_include_tag "application"
= Growstuff::Application.config.analytics_code
!= Growstuff::Application.config.analytics_code
+3 -2
View File
@@ -58,9 +58,10 @@ describe 'layouts/application.html.haml', :type => "view" do
end
it 'includes the analytics code' do
Growstuff::Application.config.analytics_code = 'ANALYTICS'
Growstuff::Application.config.analytics_code = '<script>alert("foo!")</script>'
render
rendered.should contain 'ANALYTICS'
assert_select "script", :text => 'alert("foo!")'
rendered.should_not contain 'script'
end
end