diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-07-28 03:09:28 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-07-28 03:09:28 +0300 |
commit | 2d096b1a9b759a3e4923df4dc77dea9198ca3b09 (patch) | |
tree | 0cf18a37e85d3a57d4f2d20129e9bbc116b7701e /spec/features/groups_spec.rb | |
parent | 9da482ecb8d25c8b6387f3262cfe983976333eec (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 | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/spec/features/groups_spec.rb b/spec/features/groups_spec.rb index a146f534191..70279e5067a 100644 --- a/spec/features/groups_spec.rb +++ b/spec/features/groups_spec.rb @@ -531,8 +531,8 @@ RSpec.describe 'Group' do let_it_be(:storage_enforcement_date) { Date.today + 30 } before do - allow_next_found_instance_of(Group) do |grp| - allow(grp).to receive(:storage_enforcement_date).and_return(storage_enforcement_date) + allow_next_found_instance_of(Group) do |group| + allow(group).to receive(:storage_enforcement_date).and_return(storage_enforcement_date) end end @@ -542,8 +542,8 @@ RSpec.describe 'Group' do end it 'does not display the banner in a paid group page' do - allow_next_found_instance_of(Group) do |grp| - allow(grp).to receive(:paid?).and_return(true) + 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 @@ -558,8 +558,8 @@ RSpec.describe 'Group' do expect_page_not_to_have_storage_enforcement_banner storage_enforcement_date = Date.today + 13 - allow_next_found_instance_of(Group) do |grp| - allow(grp).to receive(:storage_enforcement_date).and_return(storage_enforcement_date) + 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) @@ -567,8 +567,12 @@ RSpec.describe 'Group' do end context 'with storage_enforcement_date not set' do - # This test should break and be rewritten after the implementation of the storage_enforcement_date - # TBD: https://gitlab.com/gitlab-org/gitlab/-/issues/350632 + 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) @@ -578,10 +582,10 @@ RSpec.describe 'Group' do end def expect_page_to_have_storage_enforcement_banner(storage_enforcement_date) - expect(page).to have_text "From #{storage_enforcement_date} storage limits will apply to this namespace" + 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 "storage limits will apply to this namespace" + expect(page).not_to have_text "namespace storage limits will apply" end end |