Skip to content
Snippets Groups Projects
Commit a8cc69a2 authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre
Browse files

Validate if the lists are different when moving issues between lists

parent 997e77e7
No related branches found
No related tags found
1 merge request!5548Issue boards
Loading
Loading
@@ -11,7 +11,8 @@ module Boards
private
 
def valid_move?
moving_from_list.present? && moving_to_list.present?
moving_from_list.present? && moving_to_list.present? &&
moving_from_list != moving_to_list
end
 
def moving_from_list
Loading
Loading
Loading
Loading
@@ -121,5 +121,20 @@ describe Boards::Issues::MoveService, services: true do
expect(issue).to be_reopened
end
end
context 'when moving to same list' do
let(:issue) { create(:labeled_issue, project: project, labels: [bug, development]) }
let(:params) { { from_list_id: list1.id, to_list_id: list1.id } }
it 'returns false' do
expect(described_class.new(project, user, params).execute(issue)).to eq false
end
it 'keeps issues labels' do
described_class.new(project, user, params).execute(issue)
expect(issue.reload.labels).to contain_exactly(bug, development)
end
end
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment