From 682f5e74ee791f3f1e7125c3a252651245aed6d8 Mon Sep 17 00:00:00 2001 From: Laura Jaime Date: Wed, 17 Jul 2024 08:14:21 +0200 Subject: [PATCH] Fix system tests --- ...dmin_should_be_able_to_access_admin_dashboard_spec.rb | 4 ++-- ...ent_admin_should_be_able_to_manage_assemblies_spec.rb | 9 ++++++--- ...ment_admin_should_be_able_to_manage_processes_spec.rb | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/spec/system/department_admin_should_be_able_to_access_admin_dashboard_spec.rb b/spec/system/department_admin_should_be_able_to_access_admin_dashboard_spec.rb index 5f8c218..366c759 100644 --- a/spec/system/department_admin_should_be_able_to_access_admin_dashboard_spec.rb +++ b/spec/system/department_admin_should_be_able_to_access_admin_dashboard_spec.rb @@ -16,7 +16,7 @@ it "is able to access the admin Dashboard" do expect(page).to have_content("Dashboard") - expect(page).to have_content("Welcome to the Decidim Admin Panel.") + expect(page).to have_content("Welcome to the Admin Panel.") end context "when accessing the dashboard some left menu elements should be accessible" do @@ -38,7 +38,7 @@ expect(page).to have_content("Participants") click_link "Participants" expect(page).to have_current_path "/admin/users" - expect(page).to have_content("New Participant") + expect(page).to have_content("New admin") end it "is able to access 'Newsletter'" do diff --git a/spec/system/department_admin_should_be_able_to_manage_assemblies_spec.rb b/spec/system/department_admin_should_be_able_to_manage_assemblies_spec.rb index 76fa7f7..691e6d4 100644 --- a/spec/system/department_admin_should_be_able_to_manage_assemblies_spec.rb +++ b/spec/system/department_admin_should_be_able_to_manage_assemblies_spec.rb @@ -57,9 +57,12 @@ fill_in :assembly_slug, with: "slug" fill_in :assembly_hashtag, with: "#hashtag" - attach_file :assembly_hero_image, image1_path - attach_file :assembly_banner_image, image2_path + end + + dynamically_attach_file(:assembly_hero_image, image1_path) + dynamically_attach_file(:assembly_banner_image, image2_path) + within ".new_assembly" do find("*[type=submit]").click end @@ -67,7 +70,7 @@ expect(Decidim::Assembly.last.area).to eq(area) within ".container" do - # expect(page).to have_current_path decidim_admin_assemblies.assemblies_path(parent_id: parent_assembly&.id) + expect(page).to have_current_path decidim_admin_assemblies.assemblies_path(q: { parent_id_eq: parent_assembly&.id }) expect(page).to have_content("My assembly") end end diff --git a/spec/system/department_admin_should_be_able_to_manage_processes_spec.rb b/spec/system/department_admin_should_be_able_to_manage_processes_spec.rb index 2e0a9bc..49e7849 100644 --- a/spec/system/department_admin_should_be_able_to_manage_processes_spec.rb +++ b/spec/system/department_admin_should_be_able_to_manage_processes_spec.rb @@ -76,7 +76,7 @@ fill_in :participatory_process_slug, with: "slug" fill_in :participatory_process_hashtag, with: "#hashtag" - attach_file :participatory_process_hero_image, image1_path + dynamically_attach_file(:participatory_process_hero_image, image1_path) attach_file :participatory_process_banner_image, image2_path find("*[type=submit]").click