Skip to content

Commit

Permalink
テストを検証するユーザーごとに分けた
Browse files Browse the repository at this point in the history
  • Loading branch information
Saki-htr committed Mar 13, 2022
1 parent d098ed1 commit b2bdbf3
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions test/system/home_test.rb
Expand Up @@ -88,30 +88,33 @@ class HomeTest < ApplicationSystemTestCase
assert_current_path(/niconico_calendar=#{1.month.ago.strftime('%Y-%m')}/)
end

test 'show the grass for student and trainee' do
test 'show the grass for student' do
assert users(:kimura).student?
visit_with_auth '/', 'kimura'
assert_selector 'h2.card-header__title', text: '学習時間'
logout
end

test 'show the grass for trainee' do
assert users(:kensyu).trainee?
visit_with_auth '/', 'kensyu'
assert_selector 'h2.card-header__title', text: '学習時間'
end

test 'not show the grass for mentor, adviser, and admin' do
test 'not show the grass for mentor' do
assert users(:mentormentaro).mentor?
visit_with_auth '/', 'mentormentaro'
assert_selector 'h2.page-header__title', text: 'ダッシュボード'
assert_no_selector 'h2.card-header__title', text: '学習時間'
logout
end

test 'not show the grass for adviser' do
assert users(:advijirou).adviser?
visit_with_auth '/', 'advijirou'
assert_selector 'h2.page-header__title', text: 'ダッシュボード'
assert_no_selector 'h2.card-header__title', text: '学習時間'
logout
end

test 'not show the grass for admin' do
assert users(:komagata).admin?
visit_with_auth '/', 'komagata'
assert_selector 'h2.page-header__title', text: 'ダッシュボード'
Expand Down

0 comments on commit b2bdbf3

Please sign in to comment.