diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2018-02-07 12:41:32 +0000 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2018-02-07 12:41:32 +0000 |
commit | d08bf247bc2a99120498e939ba573f44e5f27f07 (patch) | |
tree | 6fe348f4ffdc1b104374743a8e4a19621188e895 /spec/helpers | |
parent | 2b5d5b107ccc852f498d226d05d276160fc30c5a (diff) | |
parent | 5291c0bb51ae19109e09ff0ee7fca6f118288923 (diff) | |
download | gitlab-ce-d08bf247bc2a99120498e939ba573f44e5f27f07.tar.gz |
Merge branch '38175-add-domain-field-to-auto-devops-application-setting' into 'master'
Resolve "Add domain field to Auto DevOps application setting"
Closes #38175
See merge request gitlab-org/gitlab-ce!16604
Diffstat (limited to 'spec/helpers')
-rw-r--r-- | spec/helpers/auto_devops_helper_spec.rb | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/spec/helpers/auto_devops_helper_spec.rb b/spec/helpers/auto_devops_helper_spec.rb index 5e272af6073..1950c2b129b 100644 --- a/spec/helpers/auto_devops_helper_spec.rb +++ b/spec/helpers/auto_devops_helper_spec.rb @@ -82,4 +82,39 @@ describe AutoDevopsHelper do it { is_expected.to eq(false) } end end + + describe '.auto_devops_warning_message' do + subject { helper.auto_devops_warning_message(project) } + + context 'when the service is missing' do + before do + allow(helper).to receive(:missing_auto_devops_service?).and_return(true) + end + + context 'when the domain is missing' do + before do + allow(helper).to receive(:missing_auto_devops_domain?).and_return(true) + end + + it { is_expected.to match(/Auto Review Apps and Auto Deploy need a domain name and a .* to work correctly./) } + end + + context 'when the domain is not missing' do + before do + allow(helper).to receive(:missing_auto_devops_domain?).and_return(false) + end + + it { is_expected.to match(/Auto Review Apps and Auto Deploy need a .* to work correctly./) } + end + end + + context 'when the domain is missing' do + before do + allow(helper).to receive(:missing_auto_devops_service?).and_return(false) + allow(helper).to receive(:missing_auto_devops_domain?).and_return(true) + end + + it { is_expected.to eq('Auto Review Apps and Auto Deploy need a domain name to work correctly.') } + end + end end |