summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-04-21 12:46:48 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-04-22 08:01:50 +0200
commit006d8b268ca2964ca3363fae53fdff7d26a9ae08 (patch)
treeacce2f5118e0e378f216f96391bd64a8ac059c4e /spec
parent8df63d1513118f0b3643365e2950a68c80e46176 (diff)
downloadgitlab-ce-006d8b268ca2964ca3363fae53fdff7d26a9ae08.tar.gz
Add affinity checks in issue create service
Diffstat (limited to 'spec')
-rw-r--r--spec/services/issues/create_service_spec.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/spec/services/issues/create_service_spec.rb b/spec/services/issues/create_service_spec.rb
index 64921c5f473..2972c387836 100644
--- a/spec/services/issues/create_service_spec.rb
+++ b/spec/services/issues/create_service_spec.rb
@@ -3,12 +3,15 @@ require 'spec_helper'
describe Issues::CreateService, services: true do
let(:project) { create(:empty_project) }
let(:user) { create(:user) }
- let(:assignee) { create(:user) }
describe :execute do
let(:issue) { Issues::CreateService.new(project, user, opts).execute }
context 'valid params' do
+ let(:assignee) { create(:user) }
+ let(:milestone) { create(:milestone, project: project) }
+ let(:labels) { create_list(:label, 4, project: project) }
+
before do
project.team << [user, :master]
project.team << [assignee, :master]
@@ -17,12 +20,16 @@ describe Issues::CreateService, services: true do
let(:opts) do
{ title: 'Awesome issue',
description: 'please fix',
- assignee: assignee }
+ assignee: assignee,
+ label_ids: labels.map(&:id),
+ milestone_id: milestone.id }
end
it { expect(issue).to be_valid }
it { expect(issue.title).to eq('Awesome issue') }
it { expect(issue.assignee).to eq assignee }
+ it { expect(issue.labels).to match_array labels }
+ it { expect(issue.milestone).to eq milestone }
it 'creates a pending todo for new assignee' do
attributes = {