Skip to content
Open
19 changes: 19 additions & 0 deletions app/views/practices/show.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,25 @@
.container.is-xl
.row.is-gutter-width-32
.col-lg-8.col-xs-12
- if current_user.grant_course?
nav.pill-nav
ul.pill-nav__items
li.pill-nav__item
= link_to practice_path(@practice.source_practice || @practice),
class: "pill-nav__item-link #{@practice.source_practice.blank? ? 'is-active' : ''}" do
| 元プラクティス
li.pill-nav__item
= link_to practice_path(@practice.copied_practices.first || @practice),
class: "pill-nav__item-link #{@practice.source_practice.present? ? 'is-active' : ''}" do
| 給付金コース

.practice-status-buttons__note(class='!mt-3')
p
| 給付金コースのプラクティスは、専門実践教育訓練給付制度の要件を満たすために、
| 申請時点の内容を維持させています。
| そのため、継続的にブラッシュアップされている元コースと内容が異なる場合があります。
| 元バージョンも参考として「元プラクティス」タブから確認できます。

.practice.page-content
- learning_minute_statistic = @practice.learning_minute_statistic
- if learning_minute_statistic
Expand Down
11 changes: 8 additions & 3 deletions db/fixtures/categories.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ category22:
description: "就職に向けての準備に入ります。"

category23:
name: "Ruby on Rails(Rails 6.1版)"
slug: "ruby-on-rails"
description: "まずはここからはじめましょう。ここでの学習の進め方を学びます。"
name: 'Ruby on Rails(Rails 6.1版)'
slug: 'ruby-on-rails'
description: 'まずはここからはじめましょう。ここでの学習の進め方を学びます。'

category24:
name: 'Ruby(Reスキル)'
slug: 'ruby'
description: 'Rubyのプラクティスからコピーした給付金コースのプラクティスです'
10 changes: 10 additions & 0 deletions db/fixtures/categories_practices.yml
Original file line number Diff line number Diff line change
Expand Up @@ -356,3 +356,13 @@ categories_practice66_2:
practice: practice66
category: category22
position: 3

categories_practice67:
practice: practice113
category: category24
position: 16

categories_practice68:
practice: practice114
category: category24
position: 17
5 changes: 5 additions & 0 deletions db/fixtures/courses_categories.yml
Original file line number Diff line number Diff line change
Expand Up @@ -222,3 +222,8 @@ courses_category45:
course: course5
category: category23
position: 18

courses_category46:
course: course5
category: category24
position: 19
5 changes: 5 additions & 0 deletions db/fixtures/discord_profiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -335,3 +335,8 @@ discord_profile_new-mentor:
user: new-mentor
account_name: new-mentor
times_url:

discord_profile_grant-course:
user: grant-course
account_name: grant-course
times_url:
12 changes: 12 additions & 0 deletions db/fixtures/practices.yml
Original file line number Diff line number Diff line change
Expand Up @@ -764,3 +764,15 @@ practice112:
goal: "goal..."
include_progress: true
memo: "memo for mentors..."

practice113:
title: "rubyをインストールする(Reスキル)"
description: "Railsコースのプラクティスをコピーした給付金コースのプラクティスです。"
goal: "goal..."
source_practice: practice23

practice114:
title: "rbenvをインストールする(Reスキル)"
description: "Railsコースのプラクティスをコピーした給付金コースのプラクティスです。"
goal: "goal..."
source_practice: practice24
4 changes: 4 additions & 0 deletions db/fixtures/talks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -235,3 +235,7 @@ talk_pjord:
talk_new-mentor:
user: new-mentor
action_completed: true

talk_grant_course:
user: grant-course
action_completed: true
20 changes: 20 additions & 0 deletions db/fixtures/users.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1555,3 +1555,23 @@ new-mentor:
created_at: <%= Time.current %>
sent_student_followup_message: true
last_activity_at: <%= Time.current %>

grant-course:
login_name: grant-course
email: grant-course@fjord.jp
crypted_password: $2a$10$n/xv4/1luueN6plzm2OyDezWlZFyGHjQEf4hwAW1r3k.lCm0frPK. # testtest
salt: zW3kQ9ubsxQQtzzzs4ap
name: 給付金コースのユーザー
name_kana: キュウフキンコースノユーザー
github_account: grant-course
twitter_account: grant-course
facebook_url: https://www.facebook.com/fjordllc/grant-course
blog_url: http://grant-course.org
description: "給付金コースを受講中のユーザーです。"
course: course5
job: office_worker
os: mac
organization: Rails大学
updated_at: "2025-01-01 00:00:00"
created_at: "2025-01-01 00:00:00"
last_activity_at: "2025-01-01 00:00:00"
11 changes: 8 additions & 3 deletions test/fixtures/categories.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ category22:
description: "就職に向けての準備に入ります。"

category23:
name: "Ruby on Rails(Rails 6.1版)"
slug: "ruby-on-rails"
description: "まずはここからはじめましょう。ここでの学習の進め方を学びます。"
name: 'Ruby on Rails(Rails 6.1版)'
slug: 'ruby-on-rails'
description: 'まずはここからはじめましょう。ここでの学習の進め方を学びます。'

category24:
name: 'Ruby(Reスキル)'
slug: 'ruby'
description: 'Rubyのプラクティスからコピーした給付金コースのプラクティスです'
5 changes: 5 additions & 0 deletions test/fixtures/categories_practices.yml
Original file line number Diff line number Diff line change
Expand Up @@ -307,3 +307,8 @@ categories_practice63_2:
practice: practice63
category: category23
position: 2

categories_practice64:
practice: practice64
category: category24
position: 1
5 changes: 5 additions & 0 deletions test/fixtures/courses_categories.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,3 +142,8 @@ courses_category29:
course: course4
category: category3
position: 3

courses_category30:
course: course5
category: category24
position: 1
5 changes: 5 additions & 0 deletions test/fixtures/discord_profiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -244,3 +244,8 @@ discord_profile_kensyu-invoice:
user: kensyu-invoice
account_name:
times_url:

discord_profile_grant-course:
user: grant-course
account_name:
times_url:
8 changes: 7 additions & 1 deletion test/fixtures/practices.yml
Original file line number Diff line number Diff line change
Expand Up @@ -389,4 +389,10 @@ practice63:
description: "複数のカテゴリに所属しているプラクティスです(必修です)"
goal: "goal..."
include_progress: true
memo: "memo for mentors..."
memo: 'memo for mentors...'

practice64:
title: 'rubyをインストールする(Reスキル)'
description: 'Railsコースのプラクティスをコピーした給付金コースのプラクティスです。'
goal: 'goal...'
source_practice: practice23
4 changes: 4 additions & 0 deletions test/fixtures/talks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,3 +178,7 @@ talk47:
talk48:
user: kensyu-invoice
action_completed: true

talk49:
user: grant-course
action_completed: true
20 changes: 20 additions & 0 deletions test/fixtures/users.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1132,3 +1132,23 @@ kensyu-invoice:
last_activity_at: "2014-01-01 00:00:11"
sent_student_followup_message: true
training_ends_on: "2022-04-01"

grant-course:
login_name: grant-course
email: grant-course@fjord.jp
crypted_password: $2a$10$n/xv4/1luueN6plzm2OyDezWlZFyGHjQEf4hwAW1r3k.lCm0frPK. # testtest
salt: zW3kQ9ubsxQQtzzzs4ap
name: 給付金コースのユーザー
name_kana: キュウフキンコースノユーザー
github_account: grant-course
twitter_account: grant-course
facebook_url: https://www.facebook.com/fjordllc/grant-course
blog_url: http://grant-course.org
description: "給付金コースを受講中のユーザーです。"
course: course5
job: office_worker
os: mac
organization: Rails大学
updated_at: "2025-01-01 00:00:00"
created_at: "2025-01-01 00:00:00"
last_activity_at: "2025-01-01 00:00:00"
21 changes: 21 additions & 0 deletions test/system/practices_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,25 @@ def wait_for_status_change
assert_text '未解決'
assert_equal practice.questions.length, 12
end

test 'link between grant course practice and source practice' do
grant_course_practice = practices(:practice64)
source_practice = practices(:practice23)

visit_with_auth practice_path(grant_course_practice), 'grant-course'
click_link '元プラクティス'
assert_current_path practice_path(source_practice)
assert_text 'rubyをインストールする'

click_link '給付金コース'
assert_current_path practice_path(grant_course_practice)
assert_text 'rubyをインストールする(Reスキル)'
end

test 'hide grant course practice link from non grant course user' do
source_practice = practices(:practice23)
visit_with_auth practice_path(source_practice), 'kimura'
assert_text 'rubyをインストールする'
assert_no_link '給付金コース'
end
end
8 changes: 4 additions & 4 deletions test/system/questions/change_user_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class ChangeUserTest < ApplicationSystemTestCase
fill_in 'question[description]', with: 'テストの質問です。'
within '.select-user' do
find('.choices__inner').click
find('#choices--js-choices-user-item-choice-13', text: 'hatsuno').click
find('.choices__item--choice', text: 'hatsuno').click
end
click_button '登録する'
assert_selector '.a-user-name', text: 'hatsuno (ハツノ シンジ)'
Expand All @@ -36,7 +36,7 @@ class ChangeUserTest < ApplicationSystemTestCase
click_link '内容修正'
within '.select-user' do
find('.choices__inner').click
find('#choices--js-choices-user-item-choice-13', text: 'hatsuno').click
find('.choices__item--choice', text: 'hatsuno').click
end
click_button '更新する'
assert_selector '.a-user-name', text: 'hatsuno (ハツノ シンジ)'
Expand All @@ -46,11 +46,11 @@ class ChangeUserTest < ApplicationSystemTestCase
visit_with_auth new_question_path, 'komagata'
within '.select-practices' do
find('.choices__inner').click
find('#choices--js-choices-practice-item-choice-12', text: 'sshdでパスワード認証を禁止にする').click
find('.choices__item--choice', text: 'sshdでパスワード認証を禁止にする').click
end
within '.select-user' do
find('.choices__inner').click
find('#choices--js-choices-user-item-choice-13', text: 'hatsuno').click
find('.choices__item--choice', text: 'hatsuno').click
end
click_button 'WIP'

Expand Down