このコミットが含まれているのは:
@@ -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
|
||||
|
||||
新しい課題から参照
ユーザをブロックする