diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-18 11:17:02 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-18 11:17:02 +0300 |
commit | b39512ed755239198a9c294b6a45e65c05900235 (patch) | |
tree | d234a3efade1de67c46b9e5a38ce813627726aa7 /spec/features/profiles/user_visits_profile_spec.rb | |
parent | d31474cf3b17ece37939d20082b07f6657cc79a9 (diff) |
Add latest changes from gitlab-org/gitlab@15-3-stable-eev15.3.0-rc42
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 |