diff options
author | Shinya Maeda <shinya@gitlab.com> | 2019-03-07 10:33:13 +0300 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2019-03-13 17:36:27 +0300 |
commit | 05c0377008438025a7e3396effefc197f6bf2a97 (patch) | |
tree | b92e8ecac3bcbc41f3be87c0629eedacd45e8c46 /spec/serializers/pipeline_entity_spec.rb | |
parent | 69ed9ae4d4bc0a64713c9a01d6ac27f9fc303101 (diff) |
Add attached flag to pipeline entity
Add spec
Fix
Fix
Add changelog
Drop attached
Remove attached
Update changelog
ok
Diffstat (limited to 'spec/serializers/pipeline_entity_spec.rb')
-rw-r--r-- | spec/serializers/pipeline_entity_spec.rb | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/spec/serializers/pipeline_entity_spec.rb b/spec/serializers/pipeline_entity_spec.rb index d510293ae38..c8308a0ae85 100644 --- a/spec/serializers/pipeline_entity_spec.rb +++ b/spec/serializers/pipeline_entity_spec.rb @@ -3,6 +3,7 @@ require 'spec_helper' describe PipelineEntity do include Gitlab::Routing + set(:project) { create(:project) } set(:user) { create(:user) } set(:project) { create(:project) } let(:request) { double('request') } @@ -134,12 +135,12 @@ describe PipelineEntity do end context 'when pipeline is detached merge request pipeline' do - let(:merge_request) { create(:merge_request, :with_merge_request_pipeline) } + let(:merge_request) { create(:merge_request, :with_detached_merge_request_pipeline) } let(:project) { merge_request.target_project } let(:pipeline) { merge_request.merge_request_pipelines.first } it 'makes detached flag true' do - expect(subject[:flags][:detached]).to be_truthy + expect(subject[:flags][:detached_merge_request_pipeline]).to be_truthy end context 'when user is a developer' do @@ -175,5 +176,19 @@ describe PipelineEntity do end end end + + context 'when pipeline is merge request pipeline' do + let(:merge_request) { create(:merge_request, :with_merge_request_pipeline, merge_sha: 'abc') } + let(:project) { merge_request.target_project } + let(:pipeline) { merge_request.merge_request_pipelines.first } + + it 'makes detached flag false' do + expect(subject[:flags][:detached_merge_request_pipeline]).to be_falsy + end + + it 'makes atached flag true' do + expect(subject[:flags][:merge_request_pipeline]).to be_truthy + end + end end end |