Skip to content

Commit

Permalink
Merge pull request #4981 from fjordllc/feature/change-confirm-prompt-…
Browse files Browse the repository at this point in the history
…to-delete-question

Q&Aを削除する際に表示する確認ダイアログの文言を変更
  • Loading branch information
komagata authored Jun 24, 2022
2 parents 9d0d328 + 102f977 commit d1e1886
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/javascript/question-edit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
// - 確認ダイアログとDELETE methodのリンクを実装する
a.js-delete.card-main-actions__muted-action(
:href='`/questions/${question.id}`',
data-confirm='本当によろしいですか?',
data-confirm='自己解決した場合は削除せずに回答を書き込んでください。本当に削除しますか?',
data-method='delete'
)
| 削除する
Expand Down
6 changes: 6 additions & 0 deletions test/system/questions_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -365,4 +365,10 @@ class QuestionsTest < ApplicationSystemTestCase
end
assert_link 'Linuxのファイル操作の基礎を覚える'
end

test 'show confirm dialog before delete' do
visit_with_auth question_path(questions(:question8)), 'kimura'
confirm_dialog = dismiss_confirm { click_link '削除する' }
assert_equal '自己解決した場合は削除せずに回答を書き込んでください。本当に削除しますか?', confirm_dialog
end
end

0 comments on commit d1e1886

Please sign in to comment.