From ac76ad4cd1142769dfd0fb05e9f43d06ff66fae4 Mon Sep 17 00:00:00 2001 From: Thomas von Deyen Date: Mon, 27 May 2024 11:04:51 +0200 Subject: [PATCH 1/2] Silence float positioning deprecation warnings in specs We deprecated float positioning in picture and file ingredients --- spec/features/admin/ingredient_pictures_feature_spec.rb | 6 ++++-- spec/views/alchemy/admin/ingredients/edit_spec.rb | 6 ++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/spec/features/admin/ingredient_pictures_feature_spec.rb b/spec/features/admin/ingredient_pictures_feature_spec.rb index 5c05afeacb..7fa05fc7f8 100644 --- a/spec/features/admin/ingredient_pictures_feature_spec.rb +++ b/spec/features/admin/ingredient_pictures_feature_spec.rb @@ -14,7 +14,9 @@ end scenario "Picture description is used as default for ingredient picture alt text" do - visit alchemy.edit_admin_ingredient_path(ingredient_picture) - expect(page).to have_field("Alternative text", placeholder: "A nice picture") + Alchemy::Deprecation.silence do + visit alchemy.edit_admin_ingredient_path(ingredient_picture) + expect(page).to have_field("Alternative text", placeholder: "A nice picture") + end end end diff --git a/spec/views/alchemy/admin/ingredients/edit_spec.rb b/spec/views/alchemy/admin/ingredients/edit_spec.rb index 57bf0e0ecb..5bbf761c44 100644 --- a/spec/views/alchemy/admin/ingredients/edit_spec.rb +++ b/spec/views/alchemy/admin/ingredients/edit_spec.rb @@ -8,6 +8,12 @@ view.instance_variable_set(:@ingredient, ingredient) end + around do |example| + Alchemy::Deprecation.silence do + example.run + end + end + context "for a picture ingredient" do let(:image) do fixture_file_upload( From 2fad69d5792e5c5878c896842086625b98787734 Mon Sep 17 00:00:00 2001 From: Thomas von Deyen Date: Mon, 27 May 2024 11:05:47 +0200 Subject: [PATCH 2/2] Use Page name in nodes specs The name is dependent from the database id. --- spec/features/admin/nodes_management_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/features/admin/nodes_management_spec.rb b/spec/features/admin/nodes_management_spec.rb index f81cd3270d..469bd6926c 100644 --- a/spec/features/admin/nodes_management_spec.rb +++ b/spec/features/admin/nodes_management_spec.rb @@ -29,7 +29,7 @@ def add_menu_item add_menu_item within "#page_nodes table" do - expect(page).to have_content("Menu node MenuA Page 1") + expect(page).to have_content("Menu node Menu#{a_page.name}") end within "[panel='nodes']" do expect(page).to have_content("(1) Menu node") @@ -59,7 +59,7 @@ def add_menu_item end within "#page_nodes table" do - expect(page).to_not have_content("Menu node MenuA Page 1") + expect(page).to_not have_content("Menu node Menu#{a_page.name}") expect(page).to have_content(Alchemy.t("No menu node for this page found")) end within "[panel='nodes']" do