このコミットが含まれているのは:
@@ -80,6 +80,26 @@ RSpec.describe 'TheatreComments', type: :request do
|
||||
expect(response).to have_http_status(:ok)
|
||||
expect(response.parsed_body.map { |row| row['no'] }).to eq([3, 2, 1])
|
||||
end
|
||||
|
||||
it '削除済みコメントは deleted として返し、本文を隠す' do
|
||||
comment_2.discard!
|
||||
|
||||
get "/theatres/#{theatre.id}/comments", params: { no_gt: 1 }
|
||||
|
||||
expect(response).to have_http_status(:ok)
|
||||
|
||||
deleted_comment = response.parsed_body.find { _1['no'] == 2 }
|
||||
expect(deleted_comment).to include(
|
||||
'deleted' => true,
|
||||
'content' => nil
|
||||
)
|
||||
|
||||
visible_comment = response.parsed_body.find { _1['no'] == 3 }
|
||||
expect(visible_comment).to include(
|
||||
'deleted' => false,
|
||||
'content' => 'third comment'
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
describe 'POST /theatres/:theatre_id/comments' do
|
||||
|
||||
新しい課題から参照
ユーザをブロックする