Skip to content

Commit 71d29b8

Browse files
committed
fixtest(oidc_only): added Devise.stub for omniauth_configs
1 parent 6be4c22 commit 71d29b8

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

test/controllers/static_controller_test.rb

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -504,10 +504,13 @@ class StaticControllerTest < ActionController::TestCase
504504
end
505505

506506
test 'should find log in button when login_through_oidc_only is enabled' do
507-
with_settings({ feature: { login_through_oidc_only: true } }) do
508-
get :home
509-
assert_select 'ul.user-options.nav.navbar-nav.navbar-right' do
510-
assert_select 'a[href="/users/auth/oidc"]', text: 'Log in', count: 1
507+
Devise.stub( :omniauth_configs, { oidc: OpenStruct.new(options: { label: "OIDC" }) }
508+
) do
509+
with_settings({ feature: { login_through_oidc_only: true } }) do
510+
get :home
511+
assert_select 'ul.user-options.nav.navbar-nav.navbar-right' do
512+
assert_select 'a[href="/users/auth/oidc"]', text: 'Log in', count: 1
513+
end
511514
end
512515
end
513516
end

0 commit comments

Comments
 (0)