-
Notifications
You must be signed in to change notification settings - Fork 1
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
コメントを更新するAPIを実装 #82
コメントを更新するAPIを実装 #82
Conversation
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.
@rikuya98
コメントしました!
context 'コンテンツが有効な場合' do | ||
let(:memo) { create(:memo) } | ||
let(:comment) { create(:comment, memo: memo) } | ||
let(:valid_comment_params) { { content: Faker::Lorem.paragraph(sentence_count: 3) } } |
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.
Nits
名前が少し冗長かなと思いました!
paramsでいいかなと!
let(:valid_comment_params) { { content: Faker::Lorem.paragraph(sentence_count: 3) } } | |
let(:params) { { content: Faker::Lorem.paragraph(sentence_count: 3) } } |
context 'バリデーションエラーになる場合' do | ||
let(:memo) { create(:memo) } | ||
let(:comment) { create(:comment, memo: memo) } | ||
let(:invalid_comment_params) { { content: '' } } |
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.
同上です
|
||
it 'コメントが更新されていないこと、422になることを確認する' do | ||
aggregate_failures do | ||
put "/memos/#{memo.id}/comments/#{comment.id}", params: { comment: invalid_comment_params }, as: :json |
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.
同上です
context '存在しないコメントIDの場合' do | ||
let(:memo) { create(:memo) } | ||
let(:comment) { create(:comment, memo: memo) } | ||
let(:valid_comment_params) { { content: Faker::Lorem.paragraph(sentence_count: 3) } } |
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.
同上です
context '存在しないメモIDの場合' do | ||
let(:memo) { create(:memo) } | ||
let(:comment) { create(:comment, memo: memo) } | ||
let(:valid_comment_params) { { content: Faker::Lorem.paragraph(sentence_count: 3) } } |
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.
同上です
let(:comment) { create(:comment, memo: memo) } | ||
let(:valid_comment_params) { { content: Faker::Lorem.paragraph(sentence_count: 3) } } | ||
|
||
it '404が返ることを確認する' do |
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.
IMO
itブロックの文言には結果を書くのが慣習的なので、
「確認する」までは書かなくていいかなと思いました!
it '404が返ることを確認する' do | |
it '404が返る' do |
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.
@rikuya98
LGTM!
対応するissue
対応内容