Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs新規作成フォームのプラクティス選択をChoices.jsに置き換える #7508

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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