diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 10:08:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 10:08:36 +0300 |
commit | 48aff82709769b098321c738f3444b9bdaa694c6 (patch) | |
tree | e00c7c43e2d9b603a5a6af576b1685e400410dee /spec/lib/gitlab/gitpod_spec.rb | |
parent | 879f5329ee916a948223f8f43d77fba4da6cd028 (diff) |
Add latest changes from gitlab-org/gitlab@13-5-stable-eev13.5.0-rc42
Diffstat (limited to 'spec/lib/gitlab/gitpod_spec.rb')
-rw-r--r-- | spec/lib/gitlab/gitpod_spec.rb | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/spec/lib/gitlab/gitpod_spec.rb b/spec/lib/gitlab/gitpod_spec.rb index f4dda42aeb4..717e396f942 100644 --- a/spec/lib/gitlab/gitpod_spec.rb +++ b/spec/lib/gitlab/gitpod_spec.rb @@ -4,30 +4,29 @@ require 'spec_helper' RSpec.describe Gitlab::Gitpod do let_it_be(:user) { create(:user) } - let(:feature_scope) { true } before do stub_feature_flags(gitpod: feature_scope) end - describe '.feature_conditional?' do - subject { described_class.feature_conditional? } - - context 'when feature is enabled globally' do - it { is_expected.to be_falsey } - end + describe '.feature_available?' do + subject { described_class.feature_available? } - context 'when feature is enabled only to a resource' do - let(:feature_scope) { user } + context 'when feature has not been set' do + let(:feature_scope) { nil } it { is_expected.to be_truthy } end - end - describe '.feature_available?' do - subject { described_class.feature_available? } + context 'when feature is disabled' do + let(:feature_scope) { false } + + it { is_expected.to be_falsey } + end context 'when feature is enabled globally' do + let(:feature_scope) { true } + it { is_expected.to be_truthy } end @@ -43,7 +42,15 @@ RSpec.describe Gitlab::Gitpod do subject { described_class.feature_enabled?(current_user) } + context 'when feature has not been set' do + let(:feature_scope) { nil } + + it { is_expected.to be_truthy } + end + context 'when feature is enabled globally' do + let(:feature_scope) { true } + it { is_expected.to be_truthy } end |