Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-03-04 15:11:11 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-03-04 15:11:11 +0300
commitd5d47b45ddddcef0f8fc80a35ca7a8a2a0765fd1 (patch)
tree3a595b7b17458fca99dcf3e808dc4c4c49ac0620 /spec/support/services
parentb0a5a92e8349ef7b6284f7e5571620e21bed1cad (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/support/services')
-rw-r--r--spec/support/services/issues/move_and_clone_services_shared_examples.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/support/services/issues/move_and_clone_services_shared_examples.rb b/spec/support/services/issues/move_and_clone_services_shared_examples.rb
new file mode 100644
index 00000000000..2b2e90c0461
--- /dev/null
+++ b/spec/support/services/issues/move_and_clone_services_shared_examples.rb
@@ -0,0 +1,22 @@
+# frozen_string_literal: true
+
+RSpec.shared_examples 'copy or reset relative position' do
+ before do
+ # ensure we have a relative position and it is known
+ old_issue.update!(relative_position: 1000)
+ end
+
+ context 'when moved to a project within same group hierarchy' do
+ it 'does not reset the relative_position' do
+ expect(subject.relative_position).to eq(1000)
+ end
+ end
+
+ context 'when moved to a project in a different group hierarchy' do
+ let_it_be(:new_project) { create(:project, group: create(:group)) }
+
+ it 'does reset the relative_position' do
+ expect(subject.relative_position).to be_nil
+ end
+ end
+end