diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-02 18:12:37 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-02 18:12:37 +0300 |
commit | 0a70b104d06b27e1d391a7035fa0500e84daaef4 (patch) | |
tree | 7c68ccfef2196f390549233024521319111c51f4 /spec/features/groups_spec.rb | |
parent | 2d337eacd93f459f702e032077b5ba123ed90c00 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features/groups_spec.rb')
-rw-r--r-- | spec/features/groups_spec.rb | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/spec/features/groups_spec.rb b/spec/features/groups_spec.rb index 65cb8770662..4e02f6f7ca2 100644 --- a/spec/features/groups_spec.rb +++ b/spec/features/groups_spec.rb @@ -517,76 +517,4 @@ RSpec.describe 'Group' do fill_in 'confirm_name_input', with: confirm_with click_button 'Confirm' end - - describe 'storage_enforcement_banner', :js do - let_it_be_with_refind(:group) { create(:group, :with_root_storage_statistics) } - let_it_be_with_refind(:user) { create(:user) } - - before do - group.root_storage_statistics.update!(storage_size: ::Namespace::MIN_STORAGE_ENFORCEMENT_USAGE) - group.add_owner(user) - sign_in(user) - end - - context 'with storage_enforcement_date set' do - let_it_be(:storage_enforcement_date) { Date.today + 30 } - - before do - allow_next_found_instance_of(Group) do |group| - allow(group).to receive(:storage_enforcement_date).and_return(storage_enforcement_date) - end - end - - it 'displays the banner in the group page' do - visit group_path(group) - expect_page_to_have_storage_enforcement_banner(storage_enforcement_date) - end - - it 'does not display the banner in a paid group page' do - allow_next_found_instance_of(Group) do |group| - allow(group).to receive(:paid?).and_return(true) - end - visit group_path(group) - expect_page_not_to_have_storage_enforcement_banner - end - - it 'does not display the banner if user has previously closed unless threshold has changed' do - visit group_path(group) - expect_page_to_have_storage_enforcement_banner(storage_enforcement_date) - find('.js-storage-enforcement-banner [data-testid="close-icon"]').click - wait_for_requests - page.refresh - expect_page_not_to_have_storage_enforcement_banner - - storage_enforcement_date = Date.today + 13 - allow_next_found_instance_of(Group) do |group| - allow(group).to receive(:storage_enforcement_date).and_return(storage_enforcement_date) - end - page.refresh - expect_page_to_have_storage_enforcement_banner(storage_enforcement_date) - end - end - - context 'with storage_enforcement_date not set' do - before do - allow_next_found_instance_of(Group) do |group| - allow(group).to receive(:storage_enforcement_date).and_return(nil) - end - end - - it 'does not display the banner in the group page' do - stub_feature_flags(namespace_storage_limit_bypass_date_check: false) - visit group_path(group) - expect_page_not_to_have_storage_enforcement_banner - end - end - end - - def expect_page_to_have_storage_enforcement_banner(storage_enforcement_date) - expect(page).to have_text "Effective #{storage_enforcement_date}, namespace storage limits will apply" - end - - def expect_page_not_to_have_storage_enforcement_banner - expect(page).not_to have_text "namespace storage limits will apply" - end end |