diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-19 18:44:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-19 18:44:42 +0300 |
commit | 4555e1b21c365ed8303ffb7a3325d773c9b8bf31 (patch) | |
tree | 5423a1c7516cffe36384133ade12572cf709398d /qa/spec/scenario/template_spec.rb | |
parent | e570267f2f6b326480d284e0164a6464ba4081bc (diff) |
Add latest changes from gitlab-org/gitlab@13-12-stable-eev13.12.0-rc42
Diffstat (limited to 'qa/spec/scenario/template_spec.rb')
-rw-r--r-- | qa/spec/scenario/template_spec.rb | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/qa/spec/scenario/template_spec.rb b/qa/spec/scenario/template_spec.rb index f07d817ea16..9800f92b306 100644 --- a/qa/spec/scenario/template_spec.rb +++ b/qa/spec/scenario/template_spec.rb @@ -3,6 +3,7 @@ RSpec.describe QA::Scenario::Template do let(:feature) { spy('Runtime::Feature') } let(:release) { spy('Runtime::Release') } + let(:gitlab_address) { 'https://gitlab.com/' } before do stub_const('QA::Runtime::Release', release) @@ -12,7 +13,7 @@ RSpec.describe QA::Scenario::Template do end it 'allows a feature to be enabled' do - subject.perform({ enable_feature: 'a-feature' }) + subject.perform({ gitlab_address: gitlab_address, enable_feature: 'a-feature' }) expect(feature).to have_received(:enable).with('a-feature') end @@ -21,7 +22,7 @@ RSpec.describe QA::Scenario::Template do allow(QA::Runtime::Feature).to receive(:enabled?) .with('another-feature').and_return(true) - subject.perform({ disable_feature: 'another-feature' }) + subject.perform({ gitlab_address: gitlab_address, disable_feature: 'another-feature' }) expect(feature).to have_received(:disable).with('another-feature') end @@ -30,7 +31,7 @@ RSpec.describe QA::Scenario::Template do allow(QA::Runtime::Feature).to receive(:enabled?) .with('another-feature').and_return(false) - subject.perform({ disable_feature: 'another-feature' }) + subject.perform({ gitlab_address: gitlab_address, disable_feature: 'another-feature' }) expect(feature).not_to have_received(:disable).with('another-feature') end @@ -38,7 +39,7 @@ RSpec.describe QA::Scenario::Template do it 'ensures an enabled feature is disabled afterwards' do allow(QA::Specs::Runner).to receive(:perform).and_raise('failed test') - expect { subject.perform({ enable_feature: 'a-feature' }) }.to raise_error('failed test') + expect { subject.perform({ gitlab_address: gitlab_address, enable_feature: 'a-feature' }) }.to raise_error('failed test') expect(feature).to have_received(:enable).with('a-feature') expect(feature).to have_received(:disable).with('a-feature') @@ -50,7 +51,7 @@ RSpec.describe QA::Scenario::Template do allow(QA::Runtime::Feature).to receive(:enabled?) .with('another-feature').and_return(true) - expect { subject.perform({ disable_feature: 'another-feature' }) }.to raise_error('failed test') + expect { subject.perform({ gitlab_address: gitlab_address, disable_feature: 'another-feature' }) }.to raise_error('failed test') expect(feature).to have_received(:disable).with('another-feature') expect(feature).to have_received(:enable).with('another-feature') @@ -62,9 +63,21 @@ RSpec.describe QA::Scenario::Template do allow(QA::Runtime::Feature).to receive(:enabled?) .with('another-feature').and_return(false) - expect { subject.perform({ disable_feature: 'another-feature' }) }.to raise_error('failed test') + expect { subject.perform({ gitlab_address: gitlab_address, disable_feature: 'another-feature' }) }.to raise_error('failed test') expect(feature).not_to have_received(:disable).with('another-feature') expect(feature).not_to have_received(:enable).with('another-feature') end + + it 'defines an about address by default' do + subject.perform( { gitlab_address: gitlab_address }) + + expect(QA::Runtime::Scenario.gitlab_address).to eq(gitlab_address) + expect(QA::Runtime::Scenario.about_address).to eq('https://about.gitlab.com/') + + subject.perform({ gitlab_address: 'http://gitlab-abc.test/' }) + + expect(QA::Runtime::Scenario.gitlab_address).to eq('http://gitlab-abc.test/') + expect(QA::Runtime::Scenario.about_address).to eq('http://about.gitlab-abc.test/') + end end |