diff options
Diffstat (limited to 'spec/helpers/storage_helper_spec.rb')
-rw-r--r-- | spec/helpers/storage_helper_spec.rb | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/spec/helpers/storage_helper_spec.rb b/spec/helpers/storage_helper_spec.rb index c2c508cf485..4b46bf169e0 100644 --- a/spec/helpers/storage_helper_spec.rb +++ b/spec/helpers/storage_helper_spec.rb @@ -51,14 +51,14 @@ RSpec.describe StorageHelper do end end - describe "storage_enforcement_banner", :saas do + describe "storage_enforcement_banner" do let_it_be_with_refind(:current_user) { create(:user) } let_it_be(:free_group) { create(:group) } let_it_be(:paid_group) { create(:group) } before do - allow(helper).to receive(:can?).with(current_user, :admin_namespace, free_group).and_return(true) - allow(helper).to receive(:can?).with(current_user, :admin_namespace, paid_group).and_return(true) + allow(helper).to receive(:can?).with(current_user, :maintain_namespace, free_group).and_return(true) + allow(helper).to receive(:can?).with(current_user, :maintain_namespace, paid_group).and_return(true) allow(helper).to receive(:current_user) { current_user } allow(paid_group).to receive(:paid?).and_return(true) @@ -84,7 +84,13 @@ RSpec.describe StorageHelper do end it 'returns nil when current_user do not have access usage quotas page' do - allow(helper).to receive(:can?).with(current_user, :admin_namespace, free_group).and_return(false) + allow(helper).to receive(:can?).with(current_user, :maintain_namespace, free_group).and_return(false) + + expect(helper.storage_enforcement_banner_info(free_group)).to be(nil) + end + + it 'returns nil when namespace_storage_limit_show_preenforcement_banner FF is disabled' do + stub_feature_flags(namespace_storage_limit_show_preenforcement_banner: false) expect(helper.storage_enforcement_banner_info(free_group)).to be(nil) end |