diff options
author | Shinya Maeda <shinya@gitlab.com> | 2018-12-05 15:57:00 +0900 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2018-12-05 15:57:52 +0900 |
commit | e62bfc7817ec024645383a9661fe7e36c13c1e01 (patch) | |
tree | 04227bafe6859ddbf5760ff9d3e1dc5e404fcb10 /spec/lib/gitlab/ci/pipeline/chain/build_spec.rb | |
parent | 23d921989b66881a647afaeafec357f15293790a (diff) | |
download | gitlab-ce-e62bfc7817ec024645383a9661fe7e36c13c1e01.tar.gz |
Merge request pipelines
Diffstat (limited to 'spec/lib/gitlab/ci/pipeline/chain/build_spec.rb')
-rw-r--r-- | spec/lib/gitlab/ci/pipeline/chain/build_spec.rb | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/spec/lib/gitlab/ci/pipeline/chain/build_spec.rb b/spec/lib/gitlab/ci/pipeline/chain/build_spec.rb index 85d73e5c382..fab071405df 100644 --- a/spec/lib/gitlab/ci/pipeline/chain/build_spec.rb +++ b/spec/lib/gitlab/ci/pipeline/chain/build_spec.rb @@ -18,6 +18,7 @@ describe Gitlab::Ci::Pipeline::Chain::Build do before_sha: nil, trigger_request: nil, schedule: nil, + merge_request: nil, project: project, current_user: user, variables_attributes: variables_attributes) @@ -76,6 +77,7 @@ describe Gitlab::Ci::Pipeline::Chain::Build do before_sha: nil, trigger_request: nil, schedule: nil, + merge_request: nil, project: project, current_user: user) end @@ -90,4 +92,31 @@ describe Gitlab::Ci::Pipeline::Chain::Build do expect(pipeline).to be_tag end end + + context 'when pipeline is running for a merge request' do + let(:command) do + Gitlab::Ci::Pipeline::Chain::Command.new( + source: :merge_request, + origin_ref: 'feature', + checkout_sha: project.commit.id, + after_sha: nil, + before_sha: nil, + trigger_request: nil, + schedule: nil, + merge_request: merge_request, + project: project, + current_user: user) + end + + let(:merge_request) { build(:merge_request, target_project: project) } + + before do + step.perform! + end + + it 'correctly indicated that this is a merge request pipeline' do + expect(pipeline).to be_merge_request + expect(pipeline.merge_request).to eq(merge_request) + end + end end |