From da4a86bd2cf10b18aecdc2c88217d4aefa196dbe Mon Sep 17 00:00:00 2001 From: Skud Date: Fri, 29 Mar 2013 10:25:28 +1100 Subject: [PATCH] Hotfix: don't escape HTML for analytics script --- app/views/layouts/application.html.haml | 2 +- spec/views/layouts/application_spec.rb | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index d8a8088e4..cc67cedee 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -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 diff --git a/spec/views/layouts/application_spec.rb b/spec/views/layouts/application_spec.rb index 51db99ef3..48cd360ce 100644 --- a/spec/views/layouts/application_spec.rb +++ b/spec/views/layouts/application_spec.rb @@ -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 = '' render - rendered.should contain 'ANALYTICS' + assert_select "script", :text => 'alert("foo!")' + rendered.should_not contain 'script' end end