diff --git a/app/views/practices/show.html.slim b/app/views/practices/show.html.slim
index f370f91046c..ac034000e37 100644
--- a/app/views/practices/show.html.slim
+++ b/app/views/practices/show.html.slim
@@ -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
diff --git a/db/fixtures/categories.yml b/db/fixtures/categories.yml
index efae29aa68d..c7fed037fc4 100644
--- a/db/fixtures/categories.yml
+++ b/db/fixtures/categories.yml
@@ -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のプラクティスからコピーした給付金コースのプラクティスです'
diff --git a/db/fixtures/categories_practices.yml b/db/fixtures/categories_practices.yml
index a1af1d1bd73..590c9e7fc1d 100644
--- a/db/fixtures/categories_practices.yml
+++ b/db/fixtures/categories_practices.yml
@@ -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
diff --git a/db/fixtures/courses_categories.yml b/db/fixtures/courses_categories.yml
index 26bc579255a..e5adfb0bd52 100644
--- a/db/fixtures/courses_categories.yml
+++ b/db/fixtures/courses_categories.yml
@@ -222,3 +222,8 @@ courses_category45:
course: course5
category: category23
position: 18
+
+courses_category46:
+ course: course5
+ category: category24
+ position: 19
diff --git a/db/fixtures/discord_profiles.yml b/db/fixtures/discord_profiles.yml
index e6dc9568f71..b812ac51866 100644
--- a/db/fixtures/discord_profiles.yml
+++ b/db/fixtures/discord_profiles.yml
@@ -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:
diff --git a/db/fixtures/practices.yml b/db/fixtures/practices.yml
index 24e8ebcf6af..e0ee1227186 100644
--- a/db/fixtures/practices.yml
+++ b/db/fixtures/practices.yml
@@ -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
diff --git a/db/fixtures/talks.yml b/db/fixtures/talks.yml
index e50167eb574..50256007cf4 100644
--- a/db/fixtures/talks.yml
+++ b/db/fixtures/talks.yml
@@ -235,3 +235,7 @@ talk_pjord:
talk_new-mentor:
user: new-mentor
action_completed: true
+
+talk_grant_course:
+ user: grant-course
+ action_completed: true
diff --git a/db/fixtures/users.yml b/db/fixtures/users.yml
index d7136570944..8d9ca6b7357 100644
--- a/db/fixtures/users.yml
+++ b/db/fixtures/users.yml
@@ -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"
diff --git a/test/fixtures/categories.yml b/test/fixtures/categories.yml
index efae29aa68d..c7fed037fc4 100644
--- a/test/fixtures/categories.yml
+++ b/test/fixtures/categories.yml
@@ -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のプラクティスからコピーした給付金コースのプラクティスです'
diff --git a/test/fixtures/categories_practices.yml b/test/fixtures/categories_practices.yml
index 176d54f027e..b8191d5feb7 100644
--- a/test/fixtures/categories_practices.yml
+++ b/test/fixtures/categories_practices.yml
@@ -307,3 +307,8 @@ categories_practice63_2:
practice: practice63
category: category23
position: 2
+
+categories_practice64:
+ practice: practice64
+ category: category24
+ position: 1
diff --git a/test/fixtures/courses_categories.yml b/test/fixtures/courses_categories.yml
index 92e66033b2a..d5b45c90c22 100644
--- a/test/fixtures/courses_categories.yml
+++ b/test/fixtures/courses_categories.yml
@@ -142,3 +142,8 @@ courses_category29:
course: course4
category: category3
position: 3
+
+courses_category30:
+ course: course5
+ category: category24
+ position: 1
diff --git a/test/fixtures/discord_profiles.yml b/test/fixtures/discord_profiles.yml
index 619a6d84944..9ccab18bb06 100644
--- a/test/fixtures/discord_profiles.yml
+++ b/test/fixtures/discord_profiles.yml
@@ -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:
diff --git a/test/fixtures/practices.yml b/test/fixtures/practices.yml
index 8ff61dbf322..c6397a9cc75 100644
--- a/test/fixtures/practices.yml
+++ b/test/fixtures/practices.yml
@@ -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
diff --git a/test/fixtures/talks.yml b/test/fixtures/talks.yml
index 2cd04fe72c1..1eccd04fedf 100644
--- a/test/fixtures/talks.yml
+++ b/test/fixtures/talks.yml
@@ -178,3 +178,7 @@ talk47:
talk48:
user: kensyu-invoice
action_completed: true
+
+talk49:
+ user: grant-course
+ action_completed: true
diff --git a/test/fixtures/users.yml b/test/fixtures/users.yml
index 1eb97fc15a0..c02b02e96fc 100644
--- a/test/fixtures/users.yml
+++ b/test/fixtures/users.yml
@@ -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"
diff --git a/test/system/practices_test.rb b/test/system/practices_test.rb
index a254b413ff0..de6021650ec 100644
--- a/test/system/practices_test.rb
+++ b/test/system/practices_test.rb
@@ -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
diff --git a/test/system/questions/change_user_test.rb b/test/system/questions/change_user_test.rb
index c05c27b8e7c..e1b1f302fab 100644
--- a/test/system/questions/change_user_test.rb
+++ b/test/system/questions/change_user_test.rb
@@ -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 (ハツノ シンジ)'
@@ -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 (ハツノ シンジ)'
@@ -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'