diff options
Diffstat (limited to 'spec/features/profiles/user_visits_profile_spec.rb')
-rw-r--r-- | spec/features/profiles/user_visits_profile_spec.rb | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/spec/features/profiles/user_visits_profile_spec.rb b/spec/features/profiles/user_visits_profile_spec.rb index 8b1af283765..7dd2e6aafa3 100644 --- a/spec/features/profiles/user_visits_profile_spec.rb +++ b/spec/features/profiles/user_visits_profile_spec.rb @@ -97,8 +97,8 @@ RSpec.describe 'User visits their profile' do let_it_be(:storage_enforcement_date) { Date.today + 30 } before do - allow_next_found_instance_of(Namespaces::UserNamespace) do |g| - allow(g).to receive(:storage_enforcement_date).and_return(storage_enforcement_date) + allow_next_found_instance_of(Namespaces::UserNamespace) do |user_namespace| + allow(user_namespace).to receive(:storage_enforcement_date).and_return(storage_enforcement_date) end end @@ -115,8 +115,8 @@ RSpec.describe 'User visits their profile' do expect_page_not_to_have_storage_enforcement_banner storage_enforcement_date = Date.today + 13 - allow_next_found_instance_of(Namespaces::UserNamespace) do |g| - allow(g).to receive(:storage_enforcement_date).and_return(storage_enforcement_date) + allow_next_found_instance_of(Namespaces::UserNamespace) do |user_namespace| + allow(user_namespace).to receive(:storage_enforcement_date).and_return(storage_enforcement_date) end page.refresh expect_page_to_have_storage_enforcement_banner(storage_enforcement_date) @@ -124,8 +124,12 @@ RSpec.describe 'User visits their profile' 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(Namespaces::UserNamespace) do |user_namespace| + allow(user_namespace).to receive(:storage_enforcement_date).and_return(nil) + end + end + it 'does not display the banner in the group page' do visit(profile_path) expect_page_not_to_have_storage_enforcement_banner @@ -134,10 +138,10 @@ RSpec.describe 'User visits their profile' 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 |