2019-07-31 22:56:46 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-11-03 12:29:30 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
describe Boards::Lists::ListService do
|
2019-12-04 20:38:33 +05:30
|
|
|
let(:user) { create(:user) }
|
|
|
|
|
2016-11-03 12:29:30 +05:30
|
|
|
describe '#execute' do
|
2018-03-27 19:54:05 +05:30
|
|
|
context 'when board parent is a project' do
|
|
|
|
let(:project) { create(:project) }
|
|
|
|
let(:board) { create(:board, project: project) }
|
|
|
|
let(:label) { create(:label, project: project) }
|
|
|
|
let!(:list) { create(:list, board: board, label: label) }
|
2019-12-04 20:38:33 +05:30
|
|
|
let(:service) { described_class.new(project, user) }
|
2017-09-10 17:25:29 +05:30
|
|
|
|
2018-03-27 19:54:05 +05:30
|
|
|
it_behaves_like 'lists list service'
|
2017-09-10 17:25:29 +05:30
|
|
|
end
|
2016-11-03 12:29:30 +05:30
|
|
|
|
2018-03-27 19:54:05 +05:30
|
|
|
context 'when board parent is a group' do
|
|
|
|
let(:group) { create(:group) }
|
|
|
|
let(:board) { create(:board, group: group) }
|
|
|
|
let(:label) { create(:group_label, group: group) }
|
|
|
|
let!(:list) { create(:list, board: board, label: label) }
|
2019-12-04 20:38:33 +05:30
|
|
|
let(:service) { described_class.new(group, user) }
|
2016-11-03 12:29:30 +05:30
|
|
|
|
2018-03-27 19:54:05 +05:30
|
|
|
it_behaves_like 'lists list service'
|
2016-11-03 12:29:30 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|