Skip to content
Snippets Groups Projects
Commit 6f74c7d4 authored by James Lopez's avatar James Lopez
Browse files

fix export commits stuff

parent 3b99e4ae
No related branches found
No related tags found
1 merge request!3114Export project functionality
Pipeline #
Loading
@@ -12,8 +12,8 @@
Loading
@@ -12,8 +12,8 @@
- :merge_requests: - :merge_requests:
- :merge_request_diff - :merge_request_diff
- :notes - :notes
- :commit_statuses: - :ci_commits:
- :commit - :statuses
   
:attributes_only: :attributes_only:
:project: :project:
Loading
Loading
Loading
@@ -20,7 +20,7 @@ module Projects
Loading
@@ -20,7 +20,7 @@ module Projects
File.write(full_path, project_json_tree) File.write(full_path, project_json_tree)
true true
rescue rescue
#TODO: handle error # TODO: handle error
false false
end end
   
Loading
Loading
Loading
@@ -20,9 +20,10 @@ describe Projects::ImportExport::ProjectTreeSaver, services: true do
Loading
@@ -20,9 +20,10 @@ describe Projects::ImportExport::ProjectTreeSaver, services: true do
merge_requests: [merge_request], merge_requests: [merge_request],
labels: [label], labels: [label],
snippets: [snippet], snippets: [snippet],
releases: [release], releases: [release]
commit_statuses: [commit_status]) )
end end
let!(:ci_commit) { create(:ci_commit, project: project, sha: merge_request.last_commit.id, ref: merge_request.source_branch, statuses: [commit_status]) }
let!(:milestone) { create(:milestone, title: "Milestone v1.2", project: project) } let!(:milestone) { create(:milestone, title: "Milestone v1.2", project: project) }
let(:export_path) { "#{Dir::tmpdir}/project_tree_saver_spec" } let(:export_path) { "#{Dir::tmpdir}/project_tree_saver_spec" }
let(:shared) { Projects::ImportExport::Shared.new(relative_path: project.path_with_namespace) } let(:shared) { Projects::ImportExport::Shared.new(relative_path: project.path_with_namespace) }
Loading
@@ -86,10 +87,6 @@ describe Projects::ImportExport::ProjectTreeSaver, services: true do
Loading
@@ -86,10 +87,6 @@ describe Projects::ImportExport::ProjectTreeSaver, services: true do
expect(saved_project_json['issues'].first['notes']).not_to be_empty expect(saved_project_json['issues'].first['notes']).not_to be_empty
end end
   
it 'has commit statuses' do
expect(saved_project_json['commit_statuses']).not_to be_empty
end
it 'has project members' do it 'has project members' do
expect(saved_project_json['project_members']).not_to be_empty expect(saved_project_json['project_members']).not_to be_empty
end end
Loading
@@ -102,8 +99,12 @@ describe Projects::ImportExport::ProjectTreeSaver, services: true do
Loading
@@ -102,8 +99,12 @@ describe Projects::ImportExport::ProjectTreeSaver, services: true do
expect(saved_project_json['merge_requests'].first['notes']).not_to be_empty expect(saved_project_json['merge_requests'].first['notes']).not_to be_empty
end end
   
it 'has commit statuses' do
expect(saved_project_json['ci_commits'].first['statuses']).not_to be_empty
end
it 'has ci commits' do it 'has ci commits' do
expect(saved_project_json['commit_statuses'].first['commit']).not_to be_empty expect(saved_project_json['ci_commits']).not_to be_empty
end end
end end
end end
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment