$("#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();
});
<%# :tabindex starts high to allow rendering at the bottom of the template %>
<%= form_tag(auth_path(:provider => "openid"), :id => "openid_login_form") do %>
- <div id="login_openid_url" class="mb-3">
+ <div class="mb-3">
<label for="openid_url" class="form-label">
<%= image_tag "openid.svg", :size => "36", :alt => "", :class => "align-text-bottom" %>
<%= t ".openid_url" %>
<span class="form-text text-body-secondary">(<a href="<%= t "accounts.edit.openid.link" %>" target="_new"><%= t "accounts.edit.openid.link text" %></a>)</span>
</div>
- <%= 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 %>
</div>
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