From f7f03ce9731b72e9c3f4cfc47f2335b45cadec37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Bol=C3=ADvar?= Date: Mon, 30 Oct 2023 13:35:56 +0100 Subject: [PATCH] Fix tests --- spec/system/account_spec.rb | 4 ++-- spec/system/block_email_edit_spec.rb | 2 +- spec/system/homepage_spec.rb | 2 +- spec/system/login_spec.rb | 2 +- spec/system/scoped_admins_spec.rb | 16 ++++++++-------- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/spec/system/account_spec.rb b/spec/system/account_spec.rb index 1ef40ff..eab3c83 100644 --- a/spec/system/account_spec.rb +++ b/spec/system/account_spec.rb @@ -3,8 +3,8 @@ require "rails_helper" describe "Visit the account page", type: :system do - let(:organization) { create :organization } - let(:user) { create :user, organization: organization } + let(:organization) { create :organization, external_domain_whitelist: %w(home.url registration.url) } + let(:user) { create :user, :confirmed, organization: organization } before do switch_to_host(organization.host) diff --git a/spec/system/block_email_edit_spec.rb b/spec/system/block_email_edit_spec.rb index baf60e9..7b567cd 100644 --- a/spec/system/block_email_edit_spec.rb +++ b/spec/system/block_email_edit_spec.rb @@ -10,7 +10,7 @@ end context "when visiting account page" do - let(:user) { create(:user, organization: organization) } + let(:user) { create(:user, :confirmed, organization: organization) } before do switch_to_host(organization.host) diff --git a/spec/system/homepage_spec.rb b/spec/system/homepage_spec.rb index 7a93aee..ca51035 100644 --- a/spec/system/homepage_spec.rb +++ b/spec/system/homepage_spec.rb @@ -3,7 +3,7 @@ require "rails_helper" describe "Visit the home page", type: :system, perform_enqueued: true do - let(:organization) { create :organization } + let(:organization) { create :organization, external_domain_whitelist: %w(home.url registration.url) } before do switch_to_host(organization.host) diff --git a/spec/system/login_spec.rb b/spec/system/login_spec.rb index 2a8a847..5c83219 100644 --- a/spec/system/login_spec.rb +++ b/spec/system/login_spec.rb @@ -3,7 +3,7 @@ require "rails_helper" describe "Visit the account page", type: :system do - let(:organization) { create :organization, users_registration_mode: "disabled" } + let(:organization) { create :organization, users_registration_mode: "disabled", external_domain_whitelist: %w(home.url registration.url) } let(:user) { create :user, organization: organization } before do diff --git a/spec/system/scoped_admins_spec.rb b/spec/system/scoped_admins_spec.rb index f531b17..9209105 100644 --- a/spec/system/scoped_admins_spec.rb +++ b/spec/system/scoped_admins_spec.rb @@ -5,7 +5,7 @@ describe "Scoped admins", type: :system do let(:organization) { create(:organization) } - let(:user) { create(:user, :confirmed, organization: organization) } + let(:user) { create(:user, :confirmed, :admin_terms_accepted, organization: organization) } let!(:participatory_process) { create :participatory_process, participatory_process_group: participatory_process_group, organization: organization } let!(:another_participatory_process) { create :participatory_process, organization: organization } @@ -49,27 +49,27 @@ end it "has access to managers module" do - visit catcomu_managers_admin.scoped_admins_path + visit decidim_catcomu_managers_admin.scoped_admins_path expect(page).to have_content("Participative processes in this group") end it "can edit the group" do - visit catcomu_managers_admin.scoped_admins_path + visit decidim_catcomu_managers_admin.scoped_admins_path click_link "Edit this group" expect(page).to have_content("Edit process group") end it "does not show other processes" do - visit catcomu_managers_admin.scoped_admins_path + visit decidim_catcomu_managers_admin.scoped_admins_path expect(page).to have_content(participatory_process.title["en"]) expect(page).not_to have_content(another_participatory_process.title["en"]) end it "can edit the processes" do - visit catcomu_managers_admin.scoped_admins_path + visit decidim_catcomu_managers_admin.scoped_admins_path click_link href: "/admin/participatory_processes/#{participatory_process.slug}/edit" expect(page).to have_content("General Information") @@ -85,7 +85,7 @@ end it "cannot change the group of the process" do - visit catcomu_managers_admin.scoped_admins_path + visit decidim_catcomu_managers_admin.scoped_admins_path click_link href: "/admin/participatory_processes/#{participatory_process.slug}/edit" fill_in_i18n( @@ -102,7 +102,7 @@ let(:user) { create(:user, :admin, :confirmed, organization: organization) } it "can change the group of the process" do - visit catcomu_managers_admin.scoped_admins_path + visit decidim_catcomu_managers_admin.scoped_admins_path click_link href: "/admin/participatory_processes/#{participatory_process.slug}/edit" fill_in_i18n( @@ -128,7 +128,7 @@ end it "has not actions in managers module" do - visit catcomu_managers_admin.scoped_admins_path + visit decidim_catcomu_managers_admin.scoped_admins_path expect(page).to have_content("Sorry, your user is not scoped into a group of processes!") expect(page).not_to have_content(participatory_process.title["en"])