Skip to content

Commit

Permalink
管理者以外の一般ユーザーは、ユーザーのコースを変更できないテストを追加
Browse files Browse the repository at this point in the history
  • Loading branch information
Saki-htr committed Apr 17, 2022
1 parent 935a07a commit 16b7905
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/system/admin/users_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -226,4 +226,11 @@ class Admin::UsersTest < ApplicationSystemTestCase
click_on '更新する'
assert_equal 'iOSプログラマー', user.reload.course.title
end

test 'general user cannot change user course' do
user = users(:kensyu)
visit_with_auth "/admin/users/#{user.id}/edit", 'kimura'
assert_current_path('/')
assert_text '管理者としてログインしてください'
end
end

0 comments on commit 16b7905

Please sign in to comment.