From ca404170f0173f180b530fbc331fc73e122a4317 Mon Sep 17 00:00:00 2001 From: Mike Greiling Date: Tue, 3 Jan 2017 10:46:17 -0600 Subject: exclude script type=text/template from dom scrubbing --- spec/support/javascript_fixtures_helpers.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'spec/support') diff --git a/spec/support/javascript_fixtures_helpers.rb b/spec/support/javascript_fixtures_helpers.rb index 99e98eebdb4..7cf0e29db34 100644 --- a/spec/support/javascript_fixtures_helpers.rb +++ b/spec/support/javascript_fixtures_helpers.rb @@ -34,7 +34,7 @@ module JavaScriptFixturesHelpers link_tags = doc.css('link') link_tags.remove - scripts = doc.css('script') + scripts = doc.css("script:not([type='text/template'])") scripts.remove fixture = doc.to_html -- cgit v1.2.1 From 8cee3b1d36afdb95934e8867fb60c23565c2d330 Mon Sep 17 00:00:00 2001 From: Mike Greiling Date: Tue, 3 Jan 2017 15:26:14 -0600 Subject: force utf-8 encoding for prior to fixture parsing to prevent nokogiri issues --- spec/support/javascript_fixtures_helpers.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'spec/support') diff --git a/spec/support/javascript_fixtures_helpers.rb b/spec/support/javascript_fixtures_helpers.rb index 7cf0e29db34..d15aac61b18 100644 --- a/spec/support/javascript_fixtures_helpers.rb +++ b/spec/support/javascript_fixtures_helpers.rb @@ -26,6 +26,7 @@ module JavaScriptFixturesHelpers def store_frontend_fixture(response, fixture_file_name) fixture_file_name = File.expand_path(fixture_file_name, FIXTURE_PATH) fixture = response.body + fixture.force_encoding("utf-8") response_mime_type = Mime::Type.lookup(response.content_type) if response_mime_type.html? -- cgit v1.2.1