From 66140c8d1d9fb40f503ae355dcc6b217397e0bd3 Mon Sep 17 00:00:00 2001 From: Anton Khorev Date: Fri, 12 Jul 2024 14:22:11 +0300 Subject: [PATCH] Show/hide entire OpenID form --- app/assets/javascripts/auth_providers.js | 6 ++---- app/views/application/_auth_providers.html.erb | 4 ++-- test/system/user_signup_test.rb | 12 ++++++++++++ 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/app/assets/javascripts/auth_providers.js b/app/assets/javascripts/auth_providers.js index 75eca253e..38a7287a0 100644 --- a/app/assets/javascripts/auth_providers.js +++ b/app/assets/javascripts/auth_providers.js @@ -12,11 +12,9 @@ $(document).ready(function () { $("#openid_open_url").click(function () { $("#openid_url").val("http://"); $("#login_auth_buttons").hide(); - $("#login_openid_url").show(); - $("#openid_login_button").show(); + $("#openid_login_form").show(); }); // Hide OpenID field for now - $("#login_openid_url").hide(); - $("#openid_login_button").hide(); + $("#openid_login_form").hide(); }); diff --git a/app/views/application/_auth_providers.html.erb b/app/views/application/_auth_providers.html.erb index ddf143d96..96a20fd85 100644 --- a/app/views/application/_auth_providers.html.erb +++ b/app/views/application/_auth_providers.html.erb @@ -44,7 +44,7 @@ <%# :tabindex starts high to allow rendering at the bottom of the template %> <%= form_tag(auth_path(:provider => "openid"), :id => "openid_login_form") do %> -
+
- <%= submit_tag t(".openid_login_button"), :tabindex => 21, :id => "openid_login_button", :class => "btn btn-primary" %> + <%= submit_tag t(".openid_login_button"), :tabindex => 21, :class => "btn btn-primary" %> <% end %>
diff --git a/test/system/user_signup_test.rb b/test/system/user_signup_test.rb index 0835df741..0e02b904f 100644 --- a/test/system/user_signup_test.rb +++ b/test/system/user_signup_test.rb @@ -8,4 +8,16 @@ class UserSignupTest < ApplicationSystemTestCase assert_content "Confirm Password" end + + test "Show OpenID form when OpenID provider button is clicked" do + visit login_path + + assert_no_field "OpenID URL" + assert_no_button "Continue" + + click_on "Log in with OpenID" + + assert_field "OpenID URL" + assert_button "Continue" + end end -- 2.39.5