diff options
author | wendy0402 <wendykurniawan92@gmail.com> | 2017-01-29 03:14:56 +0300 |
---|---|---|
committer | wendy0402 <wendykurniawan92@gmail.com> | 2017-02-12 05:02:03 +0300 |
commit | 9a24db121c6eda400ee531bf0253038d9fb28a52 (patch) | |
tree | 305ff89f8403d9f2472cd6923330f0f8bc502f8e /spec/services/issues | |
parent | edb8ed36cd5ce315ca45a047bd06ab1dfcf44203 (diff) |
fix issue creation from milestone doesn't assign the milestone
Diffstat (limited to 'spec/services/issues')
-rw-r--r-- | spec/services/issues/build_service_spec.rb | 11 | ||||
-rw-r--r-- | spec/services/issues/create_service_spec.rb | 1 |
2 files changed, 11 insertions, 1 deletions
diff --git a/spec/services/issues/build_service_spec.rb b/spec/services/issues/build_service_spec.rb index 4cfba35c830..09807e5d35b 100644 --- a/spec/services/issues/build_service_spec.rb +++ b/spec/services/issues/build_service_spec.rb @@ -120,11 +120,20 @@ describe Issues::BuildService, services: true do end describe '#execute' do + let(:milestone) { create(:milestone, project: project) } + it 'builds a new issues with given params' do - issue = described_class.new(project, user, title: 'Issue #1', description: 'Issue description').execute + issue = described_class.new( + project, + user, + title: 'Issue #1', + description: 'Issue description', + milestone_id: milestone.id, + ).execute expect(issue.title).to eq('Issue #1') expect(issue.description).to eq('Issue description') + expect(issue.milestone).to eq(milestone) end end end diff --git a/spec/services/issues/create_service_spec.rb b/spec/services/issues/create_service_spec.rb index 30578ee4c7d..e1feeed8a67 100644 --- a/spec/services/issues/create_service_spec.rb +++ b/spec/services/issues/create_service_spec.rb @@ -46,6 +46,7 @@ describe Issues::CreateService, services: true do expect(issue).to be_persisted expect(issue.title).to eq('Awesome issue') + expect(issue.description).to eq('please fix') expect(issue.assignee).to be_nil expect(issue.labels).to be_empty expect(issue.milestone).to be_nil |