Skip to content

Commit

Permalink
Merge pull request #7508 from fjordllc/feature/replace-practice-selec…
Browse files Browse the repository at this point in the history
…tion-in-creation-new-docs-form-with-choices-js

Docs新規作成フォームのプラクティス選択をChoices.jsに置き換える
  • Loading branch information
komagata authored Apr 24, 2024
2 parents c893f00 + d8a1640 commit 212bb69
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/views/pages/_form.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
.form-item
= f.label :practice, class: 'a-form-label'
.select-practices
= f.select(:practice_id, practice_options(categories), { include_blank: '関連プラクティスを指定しない' }, { class: 'js-select2' })
= f.select(:practice_id, practice_options(categories), { include_blank: '関連プラクティスを指定しない' }, { id: 'js-choices-single-select' })
.a-form-help
p
| どんな内容が書かれているドキュメントかを予想できるタイトルを付けましょう。
Expand Down
8 changes: 4 additions & 4 deletions test/system/pages_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ class PagesTest < ApplicationSystemTestCase
visit_with_auth new_page_path, 'kimura'
fill_in 'page[title]', with: 'Docに関連プラクティスを指定'
fill_in 'page[body]', with: 'Docに関連プラクティスを指定'
first('.select2-container').click
find('li.select2-results__option[role="option"]', text: '[UNIX] Linuxのファイル操作の基礎を覚える').click
first('.choices__inner').click
find('.choices__item--choice', text: '[UNIX] Linuxのファイル操作の基礎を覚える').click
click_button 'Docを公開'
assert_text 'Linuxのファイル操作の基礎を覚える'
end
Expand Down Expand Up @@ -182,8 +182,8 @@ class PagesTest < ApplicationSystemTestCase
visit_with_auth new_page_path, 'kimura'
fill_in 'page[title]', with: 'Docに関連プラクティスを指定'
fill_in 'page[body]', with: 'Docに関連プラクティスを指定'
first('.select2-container').click
find('li.select2-results__option[role="option"]', text: '[UNIX] Linuxのファイル操作の基礎を覚える').click
first('.choices__inner').click
find('.choices__item--choice', text: '[UNIX] Linuxのファイル操作の基礎を覚える').click
click_button 'Docを公開'
assert_text 'Linuxのファイル操作の基礎を覚える'

Expand Down

0 comments on commit 212bb69

Please sign in to comment.