Replace content_tag_for with a simple tr element

This commit is contained in:
Tom Hughes 2019-12-03 22:54:04 +00:00
parent 40809825e8
commit dba3940571
2 changed files with 12 additions and 8 deletions

View file

@ -6,19 +6,22 @@
<h3><%= t ".my_tokens" %></h3>
<p><%= t ".list_tokens" %></p>
<table>
<tr><th><%= t ".application" %></th>
<th><%= t ".issued_at" %></th><th>&nbsp;</th></tr>
<tr>
<th><%= t ".application" %></th>
<th><%= t ".issued_at" %></th>
<th>&nbsp;</th>
</tr>
<% @tokens.each do |token| %>
<%= content_tag_for :tr, token do %>
<tr>
<td><%= link_to token.client_application.name, token.client_application.url %></td>
<td><%= token.authorized_at %></td>
<td>
<%= form_tag :controller => "oauth", :action => "revoke" do %>
<%= hidden_field_tag "token", token.token %>
<%= submit_tag t(".revoke") %>
<% end %>
<%= form_tag :controller => "oauth", :action => "revoke" do %>
<%= hidden_field_tag "token", token.token %>
<%= submit_tag t(".revoke") %>
<% end %>
</td>
<% end %>
</tr>
<% end %>
</table>
<% end %>

View file

@ -37,6 +37,7 @@ class OauthClientsControllerTest < ActionController::TestCase
def test_index
user = create(:user)
create_list(:client_application, 2, :user => user)
create_list(:access_token, 2, :user => user)
get :index,
:params => { :display_name => user.display_name }