new.html.haml_spec.rb 687 Bytes
Newer Older
1
2
3
4
5
6
require "spec_helper"

describe "projects/imports/new.html.haml" do
  let(:user) { create(:user) }

  context 'when import fails' do
7
    let(:project) { create(:project_empty_repo, :import_failed, import_type: :gitlab_project, import_source: '/var/opt/gitlab/gitlab-rails/shared/tmp/project_exports/uploads/t.tar.gz', import_url: nil) }
8
9

    before do
10
      project.import_state.update_attributes(last_error: '<a href="http://googl.com">Foo</a>')
11
      sign_in(user)
12
      project.add_master(user)
13
14
15
16
17
18
19
20
21
22
23
    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