このコミットが含まれているのは:
2026-06-14 05:31:00 +09:00
コミット 791b52e894
5個のファイルの変更413行の追加13行の削除
+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