summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Goodman <jgoodman@gitlab.com>2019-08-27 17:28:23 -0400
committerJason Goodman <jgoodman@gitlab.com>2019-08-30 16:38:43 -0400
commit4dddeb25b4c36eb4f88b1fa350fb3b6aaf47fd5e (patch)
treeb8394deb6faaa83d23553c3c2345192eca3fa614
parenta657155eb2ef2b019786d87258f5f82269970659 (diff)
downloadgitlab-ce-4dddeb25b4c36eb4f88b1fa350fb3b6aaf47fd5e.tar.gz
Delete feature flag client spec
-rw-r--r--spec/lib/feature_flag_client_spec.rb54
1 files changed, 0 insertions, 54 deletions
diff --git a/spec/lib/feature_flag_client_spec.rb b/spec/lib/feature_flag_client_spec.rb
deleted file mode 100644
index 5962ab5a985..00000000000
--- a/spec/lib/feature_flag_client_spec.rb
+++ /dev/null
@@ -1,54 +0,0 @@
-require 'spec_helper'
-
-describe FeatureFlagClient do
- before do
- allow(ENV).to receive(:[]).and_call_original
- allow(Unleash::Client).to receive(:new).and_return("fake client instance")
- described_class.instance_variable_set(:@client, nil)
- end
-
- describe '.enabled?' do
- it 'returns false' do
- expect(described_class.enabled?(:feature_flag)).to eq(false)
- end
-
- it 'sets configuration based on environment variables' do
- allow(ENV).to receive(:[]).with('GITLAB_FEATURE_FLAG_SERVER_URL').and_return('some server url')
- allow(ENV).to receive(:[]).with('GITLAB_FEATURE_FLAG_INSTANCE_ID').and_return('some instance id')
- expect(Unleash::Client).to receive(:new).with(
- url: 'some server url',
- instance_id: 'some instance id',
- app_name: Rails.env
- )
-
- described_class.enabled?(:my_feature)
- end
-
- it 'is a singleton' do
- allow(ENV).to receive(:[]).with('GITLAB_FEATURE_FLAG_SERVER_URL').and_return('some server url')
- allow(ENV).to receive(:[]).with('GITLAB_FEATURE_FLAG_INSTANCE_ID').and_return('some instance id')
- expect(Unleash::Client).to receive(:new).with(
- url: 'some server url',
- instance_id: 'some instance id',
- app_name: Rails.env
- ).once
-
- described_class.enabled?(:my_feature)
- described_class.enabled?(:my_feature)
- end
-
- it 'does not set the configuration without a server url' do
- allow(ENV).to receive(:[]).with('GITLAB_FEATURE_FLAG_INSTANCE_ID').and_return('some instance id')
- expect(Unleash::Client).not_to receive(:new)
-
- described_class.enabled?(:my_feature)
- end
-
- it 'does not set the configuration without an instance id' do
- allow(ENV).to receive(:[]).with('GITLAB_FEATURE_FLAG_SERVER_URL').and_return('some server url')
- expect(Unleash::Client).not_to receive(:new)
-
- described_class.enabled?(:my_feature)
- end
- end
-end