Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fblupi committed Oct 30, 2023
1 parent bc9f6cb commit f7f03ce
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions spec/system/account_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion spec/system/block_email_edit_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion spec/system/homepage_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion spec/system/login_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 8 additions & 8 deletions spec/system/scoped_admins_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down Expand Up @@ -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")
Expand All @@ -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(
Expand All @@ -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(
Expand All @@ -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"])
Expand Down

0 comments on commit f7f03ce

Please sign in to comment.