diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 11:18:50 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 11:18:50 +0000 |
commit | 8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781 (patch) | |
tree | a77e7fe7a93de11213032ed4ab1f33a3db51b738 /qa/spec/runtime/feature_spec.rb | |
parent | 00b35af3db1abfe813a778f643dad221aad51fca (diff) | |
download | gitlab-ce-8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781.tar.gz |
Add latest changes from gitlab-org/gitlab@13-1-stable-ee
Diffstat (limited to 'qa/spec/runtime/feature_spec.rb')
-rw-r--r-- | qa/spec/runtime/feature_spec.rb | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/qa/spec/runtime/feature_spec.rb b/qa/spec/runtime/feature_spec.rb index 94638d99b01..db3c2f65963 100644 --- a/qa/spec/runtime/feature_spec.rb +++ b/qa/spec/runtime/feature_spec.rb @@ -25,6 +25,21 @@ describe QA::Runtime::Feature do end end + describe '.enable_and_verify' do + it 'enables a feature flag' do + allow(described_class).to receive(:get).and_return(response_get) + + expect(QA::Runtime::API::Request).to receive(:new) + .with(api_client, "/features/a-flag").and_return(request) + expect(described_class).to receive(:post) + .with(request.url, { value: true }).and_return(response_post) + expect(QA::Runtime::API::Request).to receive(:new) + .with(api_client, "/features").and_return(request) + + subject.enable_and_verify('a-flag') + end + end + describe '.disable' do it 'disables a feature flag' do expect(QA::Runtime::API::Request) @@ -40,6 +55,22 @@ describe QA::Runtime::Feature do end end + describe '.disable_and_verify' do + it 'disables a feature flag' do + allow(described_class).to receive(:get) + .and_return(Struct.new(:code, :body).new(200, '[{ "name": "a-flag", "state": "off" }]')) + + expect(QA::Runtime::API::Request).to receive(:new) + .with(api_client, "/features/a-flag").and_return(request) + expect(described_class).to receive(:post) + .with(request.url, { value: false }).and_return(response_post) + expect(QA::Runtime::API::Request).to receive(:new) + .with(api_client, "/features").and_return(request) + + subject.disable_and_verify('a-flag') + end + end + describe '.enabled?' do it 'returns a feature flag state' do expect(QA::Runtime::API::Request) |