diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-01-20 14:44:31 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-01-20 14:44:31 +0300 |
commit | 1f314195ea79e0c2610c979c6716134ebe21ec2a (patch) | |
tree | 741ecd91c2f6e717dbde65d528a5a529307ae0ee /spec | |
parent | 5a41d92b9d73cbc41b649239e40a15955094f77e (diff) |
Do not generate pipeline ref path if ref not present
Diffstat (limited to 'spec')
-rw-r--r-- | spec/serializers/pipeline_entity_spec.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/serializers/pipeline_entity_spec.rb b/spec/serializers/pipeline_entity_spec.rb index b19464c7117..ccb72973f9c 100644 --- a/spec/serializers/pipeline_entity_spec.rb +++ b/spec/serializers/pipeline_entity_spec.rb @@ -134,5 +134,17 @@ describe PipelineEntity do expect(subject).not_to have_key(:yaml_errors) end end + + context 'when pipeline ref is empty' do + let(:pipeline) { create(:ci_empty_pipeline) } + + before do + allow(pipeline).to receive(:ref).and_return(nil) + end + + it 'does not generate branch path' do + expect(subject[:ref][:path]).to be_nil + end + end end end |