summaryrefslogtreecommitdiff
path: root/spec/support/services/issues/move_and_clone_services_shared_examples.rb
blob: 2b2e90c0461c2f76d141b86a1a9ddea651f99dc9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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