Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Greiling <mike@pixelcog.com>2017-01-05 23:10:43 +0300
committerMike Greiling <mike@pixelcog.com>2017-01-05 23:10:43 +0300
commit10d483eaaaccc336399fa83a0ac5f7ecd9cea352 (patch)
tree14d9df1251e0fd0cccccfd20a92f06fabf0a28dd /spec/support/javascript_fixtures_helpers.rb
parent5997a86e680e22454522819e1b959d18cad48d1f (diff)
parentdf5223de61253ba1511ae3ecbb7c447819177ecb (diff)
Merge branch 'fix-u2f-fixtures' into 26226-generate-all-haml-fixtures-within-teaspoon-fixtures-task
* fix-u2f-fixtures: generate u2f frontend fixtures dynamically force utf-8 encoding for prior to fixture parsing to prevent nokogiri issues exclude script type=text/template from dom scrubbing
Diffstat (limited to 'spec/support/javascript_fixtures_helpers.rb')
-rw-r--r--spec/support/javascript_fixtures_helpers.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/spec/support/javascript_fixtures_helpers.rb b/spec/support/javascript_fixtures_helpers.rb
index 29dd4de62ff..0b8729db0f9 100644
--- a/spec/support/javascript_fixtures_helpers.rb
+++ b/spec/support/javascript_fixtures_helpers.rb
@@ -39,6 +39,7 @@ module JavaScriptFixturesHelpers
#
def parse_response(response)
fixture = response.body
+ fixture.force_encoding("utf-8")
response_mime_type = Mime::Type.lookup(response.content_type)
if response_mime_type.html?
@@ -47,7 +48,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