summaryrefslogtreecommitdiff
path: root/qa/spec/scenario/template_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'qa/spec/scenario/template_spec.rb')
-rw-r--r--qa/spec/scenario/template_spec.rb25
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