diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-09-19 23:21:39 +0300 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-10-19 19:58:24 +0300 |
commit | 398ab263fd08a5d9d7b19c5b3d06f33814a474eb (patch) | |
tree | 5a7249f72bdec65e87abb597f22a68afa9fb9f74 /spec/services/issues | |
parent | d5a595b59702489c0b1026a0951157b8cfd3d65c (diff) |
Allow users to apply group labels on Issues/MRs
Diffstat (limited to 'spec/services/issues')
-rw-r--r-- | spec/services/issues/create_service_spec.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/services/issues/create_service_spec.rb b/spec/services/issues/create_service_spec.rb index 1050502fa19..5c0331ebe66 100644 --- a/spec/services/issues/create_service_spec.rb +++ b/spec/services/issues/create_service_spec.rb @@ -67,6 +67,27 @@ describe Issues::CreateService, services: true do expect(Todo.where(attributes).count).to eq 1 end + context 'when label belongs to project group' do + let(:group) { create(:group) } + let(:group_labels) { create_pair(:group_label, group: group) } + + let(:opts) do + { + title: 'Title', + description: 'Description', + label_ids: group_labels.map(&:id) + } + end + + before do + project.update(group: group) + end + + it 'assigns group labels' do + expect(issue.labels).to match_array group_labels + end + end + context 'when label belongs to different project' do let(:label) { create(:label) } |