diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2018-10-22 14:33:28 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2018-10-22 14:33:28 +0300 |
commit | 680afb3d77db2f90b1c79d3917ce5d2df187c68b (patch) | |
tree | 7aadac01c9f0b580fa8284b64acb0f688a54a8d9 /spec/features | |
parent | 5f412e3a87d1e9444bbef6475a2cd3304f541f7d (diff) |
Do not raise error when checking pipeline reference
Return from the `Ci::Pipeline#ref_exists?` in case when there is no
repository present.
This also fixes pipeline page feature specs by changing pipeline
reference instead of stubbing `ref_exist?` method.
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/projects/pipelines/pipeline_spec.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/spec/features/projects/pipelines/pipeline_spec.rb b/spec/features/projects/pipelines/pipeline_spec.rb index 5734c7e355e..cd6c37bf54d 100644 --- a/spec/features/projects/pipelines/pipeline_spec.rb +++ b/spec/features/projects/pipelines/pipeline_spec.rb @@ -241,9 +241,12 @@ describe 'Pipeline', :js do end end - context 'with deleted branch' do - before do - allow(pipeline).to receive(:ref_exists?).and_return(false) + context 'when pipeline ref does not exist in repository anymore' do + let(:pipeline) do + create(:ci_empty_pipeline, project: project, + ref: 'non-existent', + sha: project.commit.id, + user: user) end it 'does not render link to the pipeline ref' do |