Commit 0cae7abf authored by Alex Kalderimis's avatar Alex Kalderimis

We only need to test the value of `scoped_items`

The changes tested here are to see if in EE projects in the same groups
count as part of the same relative positioning set. We do not need to
test every method - just the scoping query.

Frankly a bunch of the movement tests could also be removed, but they
are all calling public methods so it is fine for them to test the
interface.
parent 84fd43cf
...@@ -419,29 +419,11 @@ RSpec.describe Issue do ...@@ -419,29 +419,11 @@ RSpec.describe Issue do
let_it_be_with_reload(:issue1) { create(:issue, project: project1, relative_position: issue.relative_position + RelativePositioning::IDEAL_DISTANCE) } let_it_be_with_reload(:issue1) { create(:issue, project: project1, relative_position: issue.relative_position + RelativePositioning::IDEAL_DISTANCE) }
let(:new_issue) { build(:issue, project: project1, relative_position: nil) } let(:new_issue) { build(:issue, project: project1, relative_position: nil) }
describe '#max_relative_position' do describe '.relative_positioning_query_base' do
it 'returns maximum position' do it 'includes cross project issues in the same group' do
expect(issue.max_relative_position).to eq issue1.relative_position siblings = Issue.relative_positioning_query_base(issue)
end
end
describe '#prev_relative_position' do
it 'returns previous position if there is an issue above' do
expect(issue1.prev_relative_position).to eq issue.relative_position
end
it 'returns nil if there is no issue above' do
expect(issue.prev_relative_position).to eq nil
end
end
describe '#next_relative_position' do
it 'returns next position if there is an issue below' do
expect(issue.next_relative_position).to eq issue1.relative_position
end
it 'returns nil if there is no issue below' do expect(siblings).to include(issue1)
expect(issue1.next_relative_position).to eq nil
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment