fixing specs and some code cleanup

This commit is contained in:
James Lopez 2016-06-15 10:37:17 +02:00
parent 7019a19b8c
commit cbd0201fdb
6 changed files with 13 additions and 7 deletions

View file

@ -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

View file

@ -1,5 +1,5 @@
%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

View file

@ -1,4 +1,4 @@
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) %>

View file

@ -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

View file

@ -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

View file

@ -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