summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/ci/pipeline/chain/command_spec.rb
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2019-03-21 20:08:32 +0700
committerShinya Maeda <shinya@gitlab.com>2019-03-29 13:58:45 +0700
commitbf639fd504c84929ff8542eef81578a6745bf428 (patch)
treeb7eb20a2ef25de759ed3d8a2ef9a063c77564c03 /spec/lib/gitlab/ci/pipeline/chain/command_spec.rb
parent3a477fec8f1fe6cf1da70a8ae0a8473ab26235bc (diff)
downloadgitlab-ce-persist-fulll-ref-path-for-mr-pipelines.tar.gz
Create detached merge request pipelinespersist-fulll-ref-path-for-mr-pipelines
By using `refs/merge-requests/:iid/head` ok ok Improve naming nicely Add nice tests add nice tests fix some more revert
Diffstat (limited to 'spec/lib/gitlab/ci/pipeline/chain/command_spec.rb')
-rw-r--r--spec/lib/gitlab/ci/pipeline/chain/command_spec.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/lib/gitlab/ci/pipeline/chain/command_spec.rb b/spec/lib/gitlab/ci/pipeline/chain/command_spec.rb
index dab0fb51bcc..5181e9c1583 100644
--- a/spec/lib/gitlab/ci/pipeline/chain/command_spec.rb
+++ b/spec/lib/gitlab/ci/pipeline/chain/command_spec.rb
@@ -48,6 +48,24 @@ describe Gitlab::Ci::Pipeline::Chain::Command do
end
end
+ describe '#merge_request_ref_exists?' do
+ subject { command.merge_request_ref_exists? }
+
+ let!(:merge_request) { create(:merge_request, source_project: project, target_project: project) }
+
+ context 'for existing merge request ref' do
+ let(:origin_ref) { merge_request.ref_path }
+
+ it { is_expected.to eq(true) }
+ end
+
+ context 'for branch ref' do
+ let(:origin_ref) { merge_request.source_branch }
+
+ it { is_expected.to eq(false) }
+ end
+ end
+
describe '#ref' do
subject { command.ref }