gitlab-org--gitlab-foss/spec/services/boards/issues/move_service_spec.rb

55 lines
1.9 KiB
Ruby
Raw Normal View History

require 'spec_helper'
describe Boards::Issues::MoveService do
describe '#execute' do
2018-02-19 14:06:16 -05:00
context 'when parent is a project' do
let(:user) { create(:user) }
let(:project) { create(:project) }
let(:board1) { create(:board, project: project) }
let(:board2) { create(:board, project: project) }
2018-02-19 14:06:16 -05:00
let(:bug) { create(:label, project: project, name: 'Bug') }
let(:development) { create(:label, project: project, name: 'Development') }
let(:testing) { create(:label, project: project, name: 'Testing') }
let(:regression) { create(:label, project: project, name: 'Regression') }
2018-02-19 14:06:16 -05:00
let!(:list1) { create(:list, board: board1, label: development, position: 0) }
let!(:list2) { create(:list, board: board1, label: testing, position: 1) }
let!(:closed) { create(:closed_list, board: board1) }
2018-02-19 14:06:16 -05:00
let(:parent) { project }
2018-02-19 14:06:16 -05:00
before do
parent.add_developer(user)
end
2018-02-19 14:06:16 -05:00
it_behaves_like 'issues move service'
end
2018-02-19 14:06:16 -05:00
context 'when parent is a group' do
let(:user) { create(:user) }
let(:group) { create(:group) }
let(:project) { create(:project, namespace: group) }
let(:board1) { create(:board, group: group) }
let(:board2) { create(:board, group: group) }
2018-02-19 14:06:16 -05:00
let(:bug) { create(:group_label, group: group, name: 'Bug') }
let(:development) { create(:group_label, group: group, name: 'Development') }
let(:testing) { create(:group_label, group: group, name: 'Testing') }
let(:regression) { create(:group_label, group: group, name: 'Regression') }
2018-02-19 14:06:16 -05:00
let!(:list1) { create(:list, board: board1, label: development, position: 0) }
let!(:list2) { create(:list, board: board1, label: testing, position: 1) }
let!(:closed) { create(:closed_list, board: board1) }
2018-02-19 14:06:16 -05:00
let(:parent) { group }
2018-02-19 14:06:16 -05:00
before do
parent.add_developer(user)
end
2017-02-27 10:45:55 -05:00
2018-02-19 14:06:16 -05:00
it_behaves_like 'issues move service'
end
end
end