-
Notifications
You must be signed in to change notification settings - Fork 72
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
[Q&A]質問の本公開時にメンター側のWatchを自動的にonにするように修正 #4530
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -228,13 +228,59 @@ class QuestionsTest < ApplicationSystemTestCase | |
assert_selector '.thread-list-item', count: 25 | ||
end | ||
|
||
test 'mentor create a question' do | ||
visit_with_auth new_question_path, 'komagata' | ||
test "mentor's watch-button is automatically on when new question is published" do | ||
visit_with_auth new_question_path, 'kimura' | ||
within 'form[name=question]' do | ||
fill_in 'question[title]', with: 'メンターのみ投稿された質問が"Watch中"になるテスト' | ||
fill_in 'question[description]', with: 'メンターのみ投稿された質問が"Watch中"になるテスト' | ||
click_button '登録する' | ||
end | ||
assert_text '質問を作成しました。' | ||
|
||
visit_with_auth questions_path, 'komagata' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 「質問を作成しました。」のチェックが抜けていましたので追加しました。 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
click_link 'メンターのみ投稿された質問が"Watch中"になるテスト' | ||
assert_text '削除する' | ||
assert_text 'Watch中' | ||
end | ||
|
||
test "mentor's watch-button is not automatically on when new question is created as WIP" do | ||
visit_with_auth new_question_path, 'kimura' | ||
within 'form[name=question]' do | ||
fill_in 'question[title]', with: 'WIPタイトル' | ||
fill_in 'question[description]', with: 'WIP本文' | ||
click_button 'WIP' | ||
end | ||
assert_text '質問をWIPとして保存しました。' | ||
|
||
visit_with_auth questions_path, 'komagata' | ||
click_link 'WIPタイトル' | ||
assert_text '削除する' | ||
assert_no_text 'Watch中' | ||
end | ||
|
||
test "mentor's watch-button is automatically on when WIP question is updated as published" do | ||
visit_with_auth new_question_path, 'kimura' | ||
within 'form[name=question]' do | ||
fill_in 'question[title]', with: 'WIPタイトル' | ||
fill_in 'question[description]', with: 'WIP本文' | ||
click_button 'WIP' | ||
end | ||
assert_text '質問をWIPとして保存しました。' | ||
|
||
visit questions_path | ||
click_link 'WIPタイトル' | ||
assert_text '削除する' | ||
click_button '内容修正' | ||
within 'form[name=question]' do | ||
fill_in 'question[title]', with: '更新されたタイトル' | ||
fill_in 'question[description]', with: '更新された本文' | ||
click_button '質問を公開' | ||
end | ||
assert_text '質問を更新しました' | ||
|
||
visit_with_auth questions_path, 'komagata' | ||
click_link '更新されたタイトル' | ||
assert_text '削除する' | ||
assert_text 'Watch中' | ||
end | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
click_button
がブロック内外にありますので統一した方が良いかと思いました。本ファイルを上から見ていくと、ブロック内で統一された方がよさそうです。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ありがとうございます!
今回作成したテスト3つについて、ブロック内に
click_button
を書くように統一いたしました。