diff options
author | Robert Speicher <rspeicher@gmail.com> | 2016-08-18 21:20:50 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2016-08-18 21:26:32 +0300 |
commit | 01fc7633d089faad3314bb8bc1a70d27c27aef70 (patch) | |
tree | c937e3003cb501b75580678da2bb4f0782616972 /spec/views | |
parent | 83bbca26f48242461606f76f69f3e3bb462666d0 (diff) |
Update Hamlit to 2.6.1
Fixes gitlab-org/gitlab-ce#21025 and gitlab-org/gitlab-ce#21017
Diffstat (limited to 'spec/views')
-rw-r--r-- | spec/views/layouts/_head.html.haml_spec.rb | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/spec/views/layouts/_head.html.haml_spec.rb b/spec/views/layouts/_head.html.haml_spec.rb new file mode 100644 index 00000000000..3fddfb3b62f --- /dev/null +++ b/spec/views/layouts/_head.html.haml_spec.rb @@ -0,0 +1,36 @@ +require 'spec_helper' + +describe 'layouts/_head' do + before do + stub_template 'layouts/_user_styles.html.haml' => '' + end + + it 'escapes HTML-safe strings in page_title' do + stub_helper_with_safe_string(:page_title) + + render + + expect(rendered).to match(%{content="foo" http-equiv="refresh"}) + end + + it 'escapes HTML-safe strings in page_description' do + stub_helper_with_safe_string(:page_description) + + render + + expect(rendered).to match(%{content="foo" http-equiv="refresh"}) + end + + it 'escapes HTML-safe strings in page_image' do + stub_helper_with_safe_string(:page_image) + + render + + expect(rendered).to match(%{content="foo" http-equiv="refresh"}) + end + + def stub_helper_with_safe_string(method) + allow_any_instance_of(PageLayoutHelper).to receive(method) + .and_return(%q{foo" http-equiv="refresh}.html_safe) + end +end |