debian-mirror-gitlab/spec/services/boards/issues/move_service_spec.rb

55 lines
1.9 KiB
Ruby
Raw Normal View History

2016-09-13 17:45:13 +05:30
require 'spec_helper'
2017-09-10 17:25:29 +05:30
describe Boards::Issues::MoveService do
2016-09-13 17:45:13 +05:30
describe '#execute' do
2018-03-27 19:54:05 +05:30
context 'when parent is a project' do
let(:user) { create(:user) }
let(:project) { create(:project) }
let(:board1) { create(:board, project: project) }
2016-11-03 12:29:30 +05:30
let(:board2) { create(:board, project: project) }
2018-03-27 19:54:05 +05:30
let(:bug) { create(:label, project: project, name: 'Bug') }
let(:development) { create(:label, project: project, name: 'Development') }
let(:testing) { create(:label, project: project, name: 'Testing') }
2016-11-03 12:29:30 +05:30
let(:regression) { create(:label, project: project, name: 'Regression') }
2018-03-27 19:54:05 +05:30
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) }
2016-09-13 17:45:13 +05:30
2018-03-27 19:54:05 +05:30
let(:parent) { project }
2016-09-13 17:45:13 +05:30
2018-03-27 19:54:05 +05:30
before do
parent.add_developer(user)
2016-09-13 17:45:13 +05:30
end
2018-03-27 19:54:05 +05:30
it_behaves_like 'issues move service'
2016-09-13 17:45:13 +05:30
end
2018-03-27 19:54:05 +05:30
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) }
2016-09-13 17:45:13 +05:30
2018-03-27 19:54:05 +05:30
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') }
2016-09-13 17:45:13 +05:30
2018-03-27 19:54:05 +05:30
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) }
2016-09-13 17:45:13 +05:30
2018-03-27 19:54:05 +05:30
let(:parent) { group }
2016-09-13 17:45:13 +05:30
2018-03-27 19:54:05 +05:30
before do
parent.add_developer(user)
2016-09-13 17:45:13 +05:30
end
2017-08-17 22:00:37 +05:30
2018-05-01 15:08:00 +05:30
it_behaves_like 'issues move service', true
2016-09-13 17:45:13 +05:30
end
end
end