グカネータ公開 (#361) (#368)

Reviewed-on: #368
Co-authored-by: miteruzo <miteruzo@naver.com>
Co-committed-by: miteruzo <miteruzo@naver.com>
このコミットはPull リクエスト #368 でマージされました.
このコミットが含まれているのは:
2026-06-14 05:33:39 +09:00
committed by みてるぞ
コミット 7ab46f907f
23個のファイルの変更3573行の追加466行の削除
+5 -4
ファイルの表示
@@ -52,16 +52,16 @@ RSpec.describe 'Gekanator games API', type: :request do
expect(response).to have_http_status(:unprocessable_entity)
end
it 'returns not found without an admin user' do
it 'returns unauthorized without a user' do
post '/gekanator/games', params: {
guessed_post_id: guessed_post.id,
correct_post_id: guessed_post.id,
answers: [] }
expect(response).to have_http_status(:not_found)
expect(response).to have_http_status(:unauthorized)
end
it 'returns not found for a non-admin user' do
it 'stores a game for a non-admin user' do
sign_in_as user
post '/gekanator/games', params: {
@@ -69,7 +69,8 @@ RSpec.describe 'Gekanator games API', type: :request do
correct_post_id: guessed_post.id,
answers: [{ question_id: 'tag:1', answer: 'yes' }] }
expect(response).to have_http_status(:not_found)
expect(response).to have_http_status(:created)
expect(GekanatorGame.find(json['id']).user).to eq(user)
end
end
end