summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2016-06-13 10:55:54 +0200
committerJames Lopez <james@jameslopez.es>2016-06-13 10:55:54 +0200
commit069bc264185f35f75c6840e26581e64a1de12d6a (patch)
treea38f015d81a4e4e577207b89e061676f8f8dfcb6 /spec/lib/gitlab
parent771f73510937186130be260d11b8dbb273d45907 (diff)
downloadgitlab-ce-069bc264185f35f75c6840e26581e64a1de12d6a.tar.gz
refactored loads of things due to commits to pipeline change
Diffstat (limited to 'spec/lib/gitlab')
-rw-r--r--spec/lib/gitlab/import_export/import_export_reader_spec.rb6
-rw-r--r--spec/lib/gitlab/import_export/project_tree_saver_spec.rb25
2 files changed, 19 insertions, 12 deletions
diff --git a/spec/lib/gitlab/import_export/import_export_reader_spec.rb b/spec/lib/gitlab/import_export/import_export_reader_spec.rb
index c4d03fecd54..19f9bdc8d3f 100644
--- a/spec/lib/gitlab/import_export/import_export_reader_spec.rb
+++ b/spec/lib/gitlab/import_export/import_export_reader_spec.rb
@@ -16,7 +16,11 @@ describe Gitlab::ImportExport::ImportExportReader, lib: true do
}
end
+ before do
+ allow_any_instance_of(Gitlab::ImportExport).to receive(:config_file).and_return(test_config)
+ end
+
it 'generates hash from project tree config' do
- expect(described_class.new(config: test_config, shared: shared).project_tree).to match(project_tree_hash)
+ expect(described_class.new(shared: shared).project_tree).to match(project_tree_hash)
end
end
diff --git a/spec/lib/gitlab/import_export/project_tree_saver_spec.rb b/spec/lib/gitlab/import_export/project_tree_saver_spec.rb
index c8505aa6be5..6e6adfd60eb 100644
--- a/spec/lib/gitlab/import_export/project_tree_saver_spec.rb
+++ b/spec/lib/gitlab/import_export/project_tree_saver_spec.rb
@@ -89,20 +89,20 @@ describe Gitlab::ImportExport::ProjectTreeSaver, services: true do
expect(saved_project_json['merge_requests'].first['notes'].first['author']).not_to be_empty
end
- it 'has commit statuses' do
- expect(saved_project_json['ci_commits'].first['statuses']).not_to be_empty
+ it 'has pipeline statuses' do
+ expect(saved_project_json['pipelines'].first['statuses']).not_to be_empty
end
- it 'has CI builds' do
- expect(saved_project_json['ci_commits'].first['statuses'].first['type']).to eq('Ci::Build')
+ it 'has pipeline builds' do
+ expect(saved_project_json['pipelines'].first['statuses'].first['type']).to eq('Ci::Build')
end
- it 'has ci commits' do
- expect(saved_project_json['ci_commits']).not_to be_empty
+ it 'has pipeline commits' do
+ expect(saved_project_json['pipelines']).not_to be_empty
end
- it 'has ci commits notes' do
- expect(saved_project_json['ci_commits'].first['notes']).not_to be_empty
+ it 'has ci pipeline notes' do
+ expect(saved_project_json['pipelines'].first['notes']).not_to be_empty
end
end
end
@@ -125,18 +125,21 @@ describe Gitlab::ImportExport::ProjectTreeSaver, services: true do
commit_status = create(:commit_status, project: project)
- ci_commit = create(:ci_commit,
+ ci_pipeline = create(:ci_pipeline,
project: project,
sha: merge_request.last_commit.id,
ref: merge_request.source_branch,
statuses: [commit_status])
- create(:ci_build, commit: ci_commit, project: project)
+ create(:ci_build, pipeline: ci_pipeline, project: project)
create(:milestone, project: project)
create(:note, noteable: issue, project: project)
create(:note, noteable: merge_request, project: project)
- create(:note, noteable: ci_commit, project: project)
create(:note, noteable: snippet, project: project)
+ create(:note_on_commit,
+ author: user,
+ project: project,
+ commit_id: ci_pipeline.sha)
project
end