Commit 97a11136 authored by Kamil Trzcinski's avatar Kamil Trzcinski

Fix create_trigger_request_service_spec

parent 517815f4
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment