diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-08 09:07:53 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-08 09:07:53 +0000 |
commit | a821bd6ad17e304ca93838a411410a44ee9cff9f (patch) | |
tree | 5444ab20a2f8b22db736a93c5c376928dde8e450 /spec/helpers/application_settings_helper_spec.rb | |
parent | f6e985dba4d0f5b1ede95e9174d30dd6a8bedf0d (diff) | |
download | gitlab-ce-a821bd6ad17e304ca93838a411410a44ee9cff9f.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/helpers/application_settings_helper_spec.rb')
-rw-r--r-- | spec/helpers/application_settings_helper_spec.rb | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/spec/helpers/application_settings_helper_spec.rb b/spec/helpers/application_settings_helper_spec.rb index 8303c4eafbe..629ac34edc1 100644 --- a/spec/helpers/application_settings_helper_spec.rb +++ b/spec/helpers/application_settings_helper_spec.rb @@ -59,4 +59,54 @@ describe ApplicationSettingsHelper do expect(helper.integration_expanded?('plantuml_')).to be_falsey end end + + describe '.self_monitoring_project_data' do + context 'when self monitoring project does not exist' do + it 'returns create_self_monitoring_project_path' do + expect(helper.self_monitoring_project_data).to include( + 'create_self_monitoring_project_path' => + create_self_monitoring_project_admin_application_settings_path + ) + end + + it 'returns status_create_self_monitoring_project_path' do + expect(helper.self_monitoring_project_data).to include( + 'status_create_self_monitoring_project_path' => + status_create_self_monitoring_project_admin_application_settings_path + ) + end + + it 'returns self_monitoring_project_exists false' do + expect(helper.self_monitoring_project_data).to include( + 'self_monitoring_project_exists' => false + ) + end + + it 'returns nil for project full_path' do + expect(helper.self_monitoring_project_data).to include( + 'self_monitoring_project_full_path' => nil + ) + end + end + + context 'when self monitoring project exists' do + let(:project) { build(:project) } + + before do + stub_application_setting(instance_administration_project: project) + end + + it 'returns self_monitoring_project_exists true' do + expect(helper.self_monitoring_project_data).to include( + 'self_monitoring_project_exists' => true + ) + end + + it 'returns project full_path' do + expect(helper.self_monitoring_project_data).to include( + 'self_monitoring_project_full_path' => project.full_path + ) + end + end + end end |