Fix create_trigger_request_service_spec
This commit is contained in:
parent
517815f40f
commit
97a11136d3
3 changed files with 8 additions and 7 deletions
|
@ -10,7 +10,8 @@ module Ci
|
|||
ci_commit = project.gl_project.ensure_ci_commit(commit.sha)
|
||||
|
||||
trigger_request = trigger.trigger_requests.create!(
|
||||
variables: variables
|
||||
variables: variables,
|
||||
commit: ci_commit,
|
||||
)
|
||||
|
||||
if ci_commit.create_builds(ref, tag, nil, trigger_request)
|
||||
|
|
|
@ -5,8 +5,8 @@ describe Ci::API::API do
|
|||
|
||||
describe 'POST /projects/:project_id/refs/:ref/trigger' do
|
||||
let!(:trigger_token) { 'secure token' }
|
||||
let!(:project) { FactoryGirl.create(:ci_project) }
|
||||
let!(:gl_project) { FactoryGirl.create(:project, gitlab_ci_project: project) }
|
||||
let!(:gl_project) { FactoryGirl.create(:project) }
|
||||
let!(:project) { FactoryGirl.create(:ci_project, gl_project: gl_project) }
|
||||
let!(:project2) { FactoryGirl.create(:ci_project) }
|
||||
let!(:trigger) { FactoryGirl.create(:ci_trigger, project: project, token: trigger_token) }
|
||||
let(:options) do
|
||||
|
|
|
@ -2,9 +2,9 @@ require 'spec_helper'
|
|||
|
||||
describe Ci::CreateTriggerRequestService do
|
||||
let(:service) { Ci::CreateTriggerRequestService.new }
|
||||
let(:project) { FactoryGirl.create :ci_project }
|
||||
let(:gl_project) { FactoryGirl.create :project, gitlab_ci_project: project }
|
||||
let(:trigger) { FactoryGirl.create :ci_trigger, project: project }
|
||||
let(:gl_project) { create(:project) }
|
||||
let(:project) { create(:ci_project, gl_project: gl_project) }
|
||||
let(:trigger) { create(:ci_trigger, project: project) }
|
||||
|
||||
before do
|
||||
stub_ci_commit_to_return_yaml_file
|
||||
|
@ -15,7 +15,7 @@ describe Ci::CreateTriggerRequestService do
|
|||
subject { service.execute(project, trigger, 'master') }
|
||||
|
||||
it { expect(subject).to be_kind_of(Ci::TriggerRequest) }
|
||||
it { expect(subject.commit).to be_kind_of(Ci::Commit) }
|
||||
it { expect(subject.builds.first).to be_kind_of(Ci::Build) }
|
||||
end
|
||||
|
||||
context 'no commit for ref' do
|
||||
|
|
Loading…
Reference in a new issue