diff options
Diffstat (limited to 'spec/lib/gitlab/import_export/project_tree_restorer_spec.rb')
-rw-r--r-- | spec/lib/gitlab/import_export/project_tree_restorer_spec.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb b/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb index 0ab3afd0074..9dfd879a1bc 100644 --- a/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb +++ b/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb @@ -179,6 +179,32 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do end end end + + context 'when restoring hierarchy of pipeline, stages and jobs' do + it 'restores pipelines' do + expect(Ci::Pipeline.all.count).to be 5 + end + + it 'restores pipeline stages' do + expect(Ci::Stage.all.count).to be 6 + end + + it 'correctly restores association between stage and a pipeline' do + expect(Ci::Stage.all).to all(have_attributes(pipeline_id: a_value > 0)) + end + + it 'restores statuses' do + expect(CommitStatus.all.count).to be 10 + end + + it 'correctly restores association between a stage and a job' do + expect(CommitStatus.all).to all(have_attributes(stage_id: a_value > 0)) + end + + it 'correctly restores association between a pipeline and a job' do + expect(CommitStatus.all).to all(have_attributes(pipeline_id: a_value > 0)) + end + end end end |