Skip to content

Commit

Permalink
fix verifications specs
Browse files Browse the repository at this point in the history
  • Loading branch information
microstudi committed Nov 6, 2024
1 parent 2ab499b commit 22c4082
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,4 +153,4 @@
it "css is not applyied" do
expect(page.execute_script("return window.getComputedStyle($('body')[0]).backgroundColor")).to eq(default_background_color)
end
end
end
8 changes: 4 additions & 4 deletions spec/system/admin/admin_manages_verifications_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
end

it "saves the configuration" do
page.execute_script("document.getElementById('config_force_authorization_after_login').tomselect.setValue(['dummy_authorization_handler', 'id_documents'])")
page.execute_script("$('#config_force_authorization_after_login').val(['dummy_authorization_handler', 'id_documents'])")

check "Allow access if any of the authorizations is granted (by default, all are required)"

Expand All @@ -30,20 +30,20 @@
expect(page).to have_content("updated successfully")
expect(last_force_authorization_after_login.reload.value).to eq(%w(dummy_authorization_handler id_documents))
expect(last_force_authorization_with_any_method.reload.value).to be(true)
expect(last_force_authorization_help_text.reload.value).to eq("en" => "<p>Help text <strong>with HTML</strong></p>", "ca" => "<p>Text d'ajuda <strong>amb HTML</strong></p>", "es" => "<p>Texto de ayuda <strong>con HTML</strong></p>")
expect(last_force_authorization_help_text.reload.value).to eq("en" => "<p>Help text </p><p><strong>with HTML</strong></p>", "ca" => "<p>Text d'ajuda </p><p><strong>amb HTML</strong></p>", "es" => "<p>Texto de ayuda </p><p><strong>con HTML</strong></p>")
end

context "when a configuration exists" do
let(:organization) { create(:organization, available_authorizations: [:dummy_authorization_handler, :another_dummy_authorization_handler]) }
let!(:force_authorization_after_login) { create(:awesome_config, organization: organization, var: :force_authorization_after_login, value: %w(dummy_authorization_handler another_dummy_authorization_handler id_documents)) }

it "allows to select all existing workflows" do
page.execute_script("document.getElementById('config_force_authorization_after_login').tomselect.setValue(['dummy_authorization_handler', 'id_documents'])")
page.execute_script("$('#config_force_authorization_after_login').val(['dummy_authorization_handler', 'id_documents'])")

click_button "Update configuration"

expect(page).to have_content("updated successfully")
expect(last_force_authorization_after_login.reload.value).to be_blank
expect(last_force_authorization_after_login.reload.value).to eq(%w(dummy_authorization_handler))
end
end
end
2 changes: 1 addition & 1 deletion spec/system/admin/custom_styles_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
let!(:participatory_process) { create(:participatory_process, organization: organization) }
let!(:config) { create(:awesome_config, organization: organization, var: :scoped_admin_styles, value: styles) }
let(:config_helper) { create(:awesome_config, organization: organization, var: :scoped_admin_style_bar) }
let(:default_background_color) { "rgb(246, 246, 246)"}
let(:default_background_color) { "rgb(246, 246, 246)" }
let(:styles) do
{
"bar" => "body {background: red;}"
Expand Down
2 changes: 1 addition & 1 deletion spec/system/custom_styles_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
let!(:participatory_process) { create :participatory_process, organization: organization }
let!(:config) { create :awesome_config, organization: organization, var: :scoped_styles, value: styles }
let(:config_helper) { create :awesome_config, organization: organization, var: :scoped_style_bar }
let(:default_background_color) { "rgb(250, 250, 250)"}
let(:default_background_color) { "rgb(250, 250, 250)" }
let(:styles) do
{
"bar" => "body {background: red;}"
Expand Down

0 comments on commit 22c4082

Please sign in to comment.