diff options
author | Robert Speicher <robert@gitlab.com> | 2017-05-02 21:32:14 +0000 |
---|---|---|
committer | Bob Van Landuyt <bob@gitlab.com> | 2017-05-10 16:48:18 +0200 |
commit | e5e94618c573fc85118ae76c1582be1ab30a72af (patch) | |
tree | 4f46de7889f62f63d68a10bd3a433bd7b195efd1 /spec/views | |
parent | ad309f5d110ebf8859b2e7196c7a1d0b039c0d7c (diff) | |
download | gitlab-ce-e5e94618c573fc85118ae76c1582be1ab30a72af.tar.gz |
Merge branch 'fix-hamlit-xss' into 'security-9-1'
New Hamlit XSS fix, does not include extraneous changes
See merge request !2095
Diffstat (limited to 'spec/views')
-rw-r--r-- | spec/views/projects/imports/new.html.haml_spec.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/views/projects/imports/new.html.haml_spec.rb b/spec/views/projects/imports/new.html.haml_spec.rb new file mode 100644 index 00000000000..9b293065797 --- /dev/null +++ b/spec/views/projects/imports/new.html.haml_spec.rb @@ -0,0 +1,22 @@ +require "spec_helper" + +describe "projects/imports/new.html.haml" do + let(:user) { create(:user) } + + context 'when import fails' do + let(:project) { create(:project_empty_repo, import_status: :failed, import_error: '<a href="http://googl.com">Foo</a>', import_type: :gitlab_project, import_source: '/var/opt/gitlab/gitlab-rails/shared/tmp/project_exports/uploads/t.tar.gz', import_url: nil) } + + before do + sign_in(user) + project.team << [user, :master] + end + + it "escapes HTML in import errors" do + assign(:project, project) + + render + + expect(rendered).not_to have_link('Foo', href: "http://googl.com") + end + end +end |