From a4e7b702273eaa3d0e6387b365247547224051dc Mon Sep 17 00:00:00 2001 From: taitus Date: Fri, 16 May 2025 10:33:52 +0200 Subject: [PATCH] Unify tests related with shows or hides new document link --- spec/system/nested_documentable_spec.rb | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/spec/system/nested_documentable_spec.rb b/spec/system/nested_documentable_spec.rb index 3e2b5bf1c..0d7cbe6b0 100644 --- a/spec/system/nested_documentable_spec.rb +++ b/spec/system/nested_documentable_spec.rb @@ -58,21 +58,15 @@ describe "Nested documentable" do documentable.update!(author: user) if edit_path?(path) end - scenario "Should show new document link when max documents allowed limit is not reached" do + scenario "Shows or hides new document link depending on max documents limit" do do_login_for(user, management: management_section?(path)) visit path expect(page).to have_link "Add new document" - end - - scenario "Should not show new document link when - documentable max documents allowed limit is reached" do - do_login_for(user, management: management_section?(path)) - visit path click_link "Add new document" - expect(page).not_to have_css "#new_document_link" + expect(page).not_to have_link "Add new document" end scenario "Should not show max documents warning when no documents added" do