AI: address review on PR #468
このコミットが含まれているのは:
@@ -2559,6 +2559,21 @@ RSpec.describe 'Posts API', type: :request do
|
||||
|
||||
expect(user.reload.viewed?(post_record)).to be(true)
|
||||
end
|
||||
|
||||
it '204 and keeps one view on repeated requests' do
|
||||
sign_in_as(user)
|
||||
|
||||
expect {
|
||||
post "/posts/#{ post_record.id }/viewed"
|
||||
}.to change(UserPostView, :count).by(1)
|
||||
expect(response).to have_http_status(:no_content)
|
||||
|
||||
expect {
|
||||
post "/posts/#{ post_record.id }/viewed"
|
||||
}.not_to change(UserPostView, :count)
|
||||
expect(response).to have_http_status(:no_content)
|
||||
expect(user.reload.viewed?(post_record)).to be(true)
|
||||
end
|
||||
end
|
||||
|
||||
describe 'DELETE /posts/:id/viewed' do
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする