BigW Consortium Gitlab

Commit 6f74c7d4 by James Lopez

fix export commits stuff

parent 3b99e4ae
...@@ -12,8 +12,8 @@ ...@@ -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:
......
...@@ -20,7 +20,7 @@ module Projects ...@@ -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
......
...@@ -20,9 +20,10 @@ describe Projects::ImportExport::ProjectTreeSaver, services: true do ...@@ -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) }
...@@ -86,10 +87,6 @@ describe Projects::ImportExport::ProjectTreeSaver, services: true do ...@@ -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
...@@ -102,8 +99,12 @@ describe Projects::ImportExport::ProjectTreeSaver, services: true do ...@@ -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
......
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