diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-30 14:02:35 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-30 14:02:35 +0300 |
commit | 434a0ce52d75e13d48eac9ce83774954c7c5d48d (patch) | |
tree | de3b7a7cf1ce8b07555f28df592297c76894c90f /spec/helpers/blob_helper_spec.rb | |
parent | 0a0d9493ca481c56b739a3df27c31262283150fe (diff) |
Add latest changes from gitlab-org/gitlab@13-7-stable-eev13.7.0-rc2
Diffstat (limited to 'spec/helpers/blob_helper_spec.rb')
-rw-r--r-- | spec/helpers/blob_helper_spec.rb | 62 |
1 files changed, 24 insertions, 38 deletions
diff --git a/spec/helpers/blob_helper_spec.rb b/spec/helpers/blob_helper_spec.rb index cafe4c4275e..764c582e987 100644 --- a/spec/helpers/blob_helper_spec.rb +++ b/spec/helpers/blob_helper_spec.rb @@ -236,53 +236,41 @@ RSpec.describe BlobHelper do let(:data) { File.read(Rails.root.join('spec/support/gitlab_stubs/gitlab_ci.yml')) } let(:blob) { fake_blob(path: Gitlab::FileDetector::PATTERNS[:gitlab_ci], data: data) } - context 'feature enabled' do - it 'is true' do - expect(helper.show_suggest_pipeline_creation_celebration?).to be_truthy - end + it 'is true' do + expect(helper.show_suggest_pipeline_creation_celebration?).to be_truthy + end - context 'file is invalid format' do - let(:data) { 'foo' } + context 'file is invalid format' do + let(:data) { 'foo' } - it 'is false' do - expect(helper.show_suggest_pipeline_creation_celebration?).to be_falsey - end + it 'is false' do + expect(helper.show_suggest_pipeline_creation_celebration?).to be_falsey end + end - context 'does not use the default ci config' do - before do - project.ci_config_path = 'something_bad' - end - - it 'is false' do - expect(helper.show_suggest_pipeline_creation_celebration?).to be_falsey - end + context 'does not use the default ci config' do + before do + project.ci_config_path = 'something_bad' end - context 'does not have the needed cookie' do - before do - helper.request.cookies.delete "suggest_gitlab_ci_yml_commit_#{project.id}" - end - - it 'is false' do - expect(helper.show_suggest_pipeline_creation_celebration?).to be_falsey - end + it 'is false' do + expect(helper.show_suggest_pipeline_creation_celebration?).to be_falsey end + end - context 'blob does not have auxiliary view' do - before do - allow(blob).to receive(:auxiliary_viewer).and_return(nil) - end + context 'does not have the needed cookie' do + before do + helper.request.cookies.delete "suggest_gitlab_ci_yml_commit_#{project.id}" + end - it 'is false' do - expect(helper.show_suggest_pipeline_creation_celebration?).to be_falsey - end + it 'is false' do + expect(helper.show_suggest_pipeline_creation_celebration?).to be_falsey end end - context 'feature disabled' do + context 'blob does not have auxiliary view' do before do - stub_feature_flags(suggest_pipeline: false) + allow(blob).to receive(:auxiliary_viewer).and_return(nil) end it 'is false' do @@ -294,10 +282,8 @@ RSpec.describe BlobHelper do context 'when file is not a pipeline config file' do let(:blob) { fake_blob(path: 'LICENSE') } - context 'feature enabled' do - it 'is false' do - expect(helper.show_suggest_pipeline_creation_celebration?).to be_falsey - end + it 'is false' do + expect(helper.show_suggest_pipeline_creation_celebration?).to be_falsey end end end |