Commit cbd0201f authored by James Lopez's avatar James Lopez

fixing specs and some code cleanup

parent 7019a19b
...@@ -7,10 +7,14 @@ ...@@ -7,10 +7,14 @@
= form_tag import_gitlab_project_path, class: 'form-horizontal', multipart: true do = form_tag import_gitlab_project_path, class: 'form-horizontal', multipart: true do
%p %p
Project will be imported to path #{@path} Project will be imported to path
%strong
#{@path}
%p %p
To get started add your exported project file below: To get started add your exported project file below, then you will be redirected to the new project page and the project will appear once the import is done.
%p
You can generate a new export file from your project settings.
.form-group .form-group
= hidden_field_tag :namespace_id, @namespace_id = hidden_field_tag :namespace_id, @namespace_id
= hidden_field_tag :path, @path = hidden_field_tag :path, @path
......
%p %p
Project #{@project.name} was exported succesfully Project #{@project.name} was exported successfully.
%p %p
The project export can be downloaded from: The project export can be downloaded from:
= link_to download_export_namespace_project_url(@project.namespace, @project) do = link_to download_export_namespace_project_url(@project.namespace, @project) do
......
Project <%= @project.name %> was exported succesfully Project <%= @project.name %> was exported successfully.
The project export can be downloaded from: The project export can be downloaded from:
<%= download_export_namespace_project_url(@project.namespace, @project) %> <%= download_export_namespace_project_url(@project.namespace, @project) %>
......
...@@ -39,10 +39,11 @@ feature 'project import', feature: true, js: true do ...@@ -39,10 +39,11 @@ feature 'project import', feature: true, js: true do
expect(project.merge_requests).not_to be_empty expect(project.merge_requests).not_to be_empty
expect(project.repo_exists?).to be true expect(project.repo_exists?).to be true
expect(wiki_exists?).to be true expect(wiki_exists?).to be true
expect(project.import_status).to eq('finished')
end end
def wiki_exists? def wiki_exists?
wiki = ProjectWiki.new(project) wiki = ProjectWiki.new(project)
File.exists?(wiki.repository.path_to_repo) && !wiki.repository.empty? File.exist?(wiki.repository.path_to_repo) && !wiki.repository.empty?
end end
end end
...@@ -6,7 +6,8 @@ describe Gitlab::ImportExport::ProjectTreeRestorer, services: true do ...@@ -6,7 +6,8 @@ describe Gitlab::ImportExport::ProjectTreeRestorer, services: true do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:namespace) { create(:namespace, owner: user) } let(:namespace) { create(:namespace, owner: user) }
let(:shared) { Gitlab::ImportExport::Shared.new(relative_path: "", project_path: 'path') } let(:shared) { Gitlab::ImportExport::Shared.new(relative_path: "", project_path: 'path') }
let(:project_tree_restorer) { described_class.new(user: user, shared: shared, namespace_id: namespace.id) } let(:project) { create(:empty_project, name: 'project', path: 'project') }
let(:project_tree_restorer) { described_class.new(user: user, shared: shared, project: project) }
let(:restored_project_json) { project_tree_restorer.restore } let(:restored_project_json) { project_tree_restorer.restore }
before do before do
......
...@@ -30,7 +30,7 @@ describe Gitlab::ImportExport::ProjectTreeSaver, services: true do ...@@ -30,7 +30,7 @@ describe Gitlab::ImportExport::ProjectTreeSaver, services: true do
end end
it 'saves the correct json' do it 'saves the correct json' do
expect(saved_project_json).to include({ "name" => project.name }) expect(saved_project_json).to include({ "visibility_level" => 20 })
end end
it 'has events' do it 'has events' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment