Skip to content

Commit

Permalink
管理者が自分以外のユーザーアイコンを変更できるテストを追加
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuichiro Makita authored and Yuichiro Makita committed Feb 13, 2025
1 parent b02c893 commit 4f83890
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion test/system/admin/users_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,21 @@ class Admin::UsersTest < ApplicationSystemTestCase

test 'update user' do
user = users(:hatsuno)
visit_with_auth "/admin/users/#{user.id}/edit", 'komagata'

visit_with_auth "/users/#{user.id}", 'komagata'
icon_before = find('img.user-profile__user-icon-image', visible: false)
assert icon_before.native['src'].end_with?('hatsuno.jpg')

visit "/admin/users/#{user.id}/edit"
within 'form[name=user]' do
fill_in 'user[login_name]', with: 'hatsuno-1'
attach_file 'user[avatar]', 'test/fixtures/files/users/avatars/komagata.jpg', make_visible: true
click_on '更新する'
end

assert_text 'ユーザー情報を更新しました。'
icon_after = find('img.user-profile__user-icon-image', visible: false)
assert icon_after.native['src'].end_with?('komagata.png')
end

test 'update user with company' do
Expand Down

0 comments on commit 4f83890

Please sign in to comment.