diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-09-27 12:06:26 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-09-27 12:06:26 +0300 |
commit | 20450649ca3132e55aea60436fa6117ca6c1ae5f (patch) | |
tree | 3b87d2e4b54e72a02dcc4d1af644fbf7269c2c2e /spec/support/shared_examples/lib | |
parent | 3f0f13c6d9f567819d175b499cb437ebf3a63a38 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/support/shared_examples/lib')
-rw-r--r-- | spec/support/shared_examples/lib/gitlab/import_export/project_tree_restorer_shared_examples.rb | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/spec/support/shared_examples/lib/gitlab/import_export/project_tree_restorer_shared_examples.rb b/spec/support/shared_examples/lib/gitlab/import_export/project_tree_restorer_shared_examples.rb new file mode 100644 index 00000000000..f26a8554055 --- /dev/null +++ b/spec/support/shared_examples/lib/gitlab/import_export/project_tree_restorer_shared_examples.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +# Shared examples for ProjectTreeRestorer (shared to allow the testing +# of EE-specific features) +RSpec.shared_examples 'restores project correctly' do |**results| + it 'restores the project' do + expect(shared.errors).to be_empty + expect(restored_project_json).to be_truthy + end + + it 'has labels' do + labels_size = results.fetch(:labels, 0) + + expect(project.labels.size).to eq(labels_size) + end + + it 'has label priorities' do + label_with_priorities = results[:label_with_priorities] + + if label_with_priorities + expect(project.labels.find_by(title: label_with_priorities).priorities).not_to be_empty + end + end + + it 'has milestones' do + expect(project.milestones.size).to eq(results.fetch(:milestones, 0)) + end + + it 'has issues' do + expect(project.issues.size).to eq(results.fetch(:issues, 0)) + end + + it 'does not set params that are excluded from import_export settings' do + expect(project.import_type).to be_nil + expect(project.creator_id).not_to eq 123 + end +end |