diff options
Diffstat (limited to 'spec/features/projects_spec.rb')
-rw-r--r-- | spec/features/projects_spec.rb | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/spec/features/projects_spec.rb b/spec/features/projects_spec.rb index f6f9c7f0d3c..d228fb084c3 100644 --- a/spec/features/projects_spec.rb +++ b/spec/features/projects_spec.rb @@ -329,7 +329,7 @@ RSpec.describe 'Project' do it 'has working links to submodules' do click_link('645f6c4c') - expect(page).to have_selector('.qa-branches-select', text: '645f6c4c82fd3f5e06f67134450a570b795e55a6') # rubocop:disable QA/SelectorUsage + expect(page).to have_selector('[data-testid="branches-select"]', text: '645f6c4c82fd3f5e06f67134450a570b795e55a6') end context 'for signed commit on default branch', :js do @@ -454,8 +454,8 @@ RSpec.describe 'Project' 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 @@ -478,8 +478,8 @@ RSpec.describe 'Project' do let_it_be(:project) { create(:project, namespace: user.namespace) } before do - allow_next_found_instance_of(Namespaces::UserNamespace) do |namspace| - allow(namspace).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 @@ -490,8 +490,8 @@ RSpec.describe 'Project' do end it 'does not display the banner in a paid group project 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 project_path(project) expect_page_not_to_have_storage_enforcement_banner @@ -506,8 +506,8 @@ RSpec.describe 'Project' 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) @@ -515,8 +515,12 @@ RSpec.describe 'Project' 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 project_path(project) @@ -526,11 +530,11 @@ RSpec.describe 'Project' 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 def remove_with_confirm(button_text, confirm_with, confirm_button_text = 'Confirm') |