Test "delete user"

This commit is contained in:
cryptogopher 2023-04-25 00:40:50 +02:00
parent c67820db58
commit b781c7e072
3 changed files with 19 additions and 2 deletions

View File

@ -15,8 +15,10 @@
<td class="svg">
<%= svg_tag "pictograms/checkbox-marked-outline" if user.confirmed_at.present? %>
</td>
<td class="actions"><%= image_link_to "Delete", "account-remove-outline", user_path(user),
data: { turbo: true, turbo_method: :delete } %></td>
<td class="actions">
<%= image_link_to t(:delete), "account-remove-outline", user_path(user),
data: { turbo: true, turbo_method: :delete } %>
</td>
</tr>
<% end %>
</table>

View File

@ -23,6 +23,7 @@ en:
application:
users: Users
actions: Actions
delete: Delete
or: or
register: Register
sign_in: Sign in

View File

@ -92,4 +92,18 @@ class UsersTest < ApplicationSystemTestCase
visit Capybara.string(mail.body.to_s).find_link("Confirm my account")[:href]
end
end
test "delete user" do
sign_in user: users.select(&:admin?).sample
click_link t('layouts.application.users')
assert_difference ->{ User.count }, -1 do
all('tr').drop(1).sample.click_link t(:delete)
end
end
test "users tab visible only for admin" do
end
test "update e-mail" do
end
end