28_introduce_rswag #35

Merged
philipp merged 46 commits from 28_introduce_rswag into develop 2023-01-05 13:45:47 +01:00
Showing only changes of commit e4d0222ae2 - Show all commits

View file

@ -75,7 +75,6 @@ describe 'User', type: :request do
run_test! run_test!
end end
# 422
response '422', 'invalid parameter value or group order article already exists' do response '422', 'invalid parameter value or group order article already exists' do
let(:group_order_article) { { order_article_id: goa.order_article_id, quantity: 1, tolerance: 2 } } let(:group_order_article) { { order_article_id: goa.order_article_id, quantity: 1, tolerance: 2 } }
schema '$ref' => '#/components/schemas/Error422' schema '$ref' => '#/components/schemas/Error422'
@ -127,42 +126,35 @@ describe 'User', type: :request do
response '200', 'success' do response '200', 'success' do
schema type: :object, properties: { schema type: :object, properties: {
group_order_article_for_create: { group_order_article: {
type: :object, '$ref': '#/components/schemas/GroupOrderArticle'
items: {
}
} }
} }
run_test! run_test!
end end
# 401
response 401, 'not logged-in' do response 401, 'not logged-in' do
let(:Authorization) { 'abc' }
schema '$ref' => '#/components/schemas/Error401' schema '$ref' => '#/components/schemas/Error401'
let(:Authorization) { 'abc' }
run_test! run_test!
end end
# 403
response 403, 'user has no ordergroup, order not open, is below minimum balance, has not enough apple points, or missing scope' do response 403, 'user has no ordergroup, order not open, is below minimum balance, has not enough apple points, or missing scope' do
let(:api_scopes) { ['none'] } let(:api_scopes) { ['none'] }
schema '$ref' => '#/components/schemas/Error403' schema '$ref' => '#/components/schemas/Error403'
run_test! run_test!
end end
# 404
response '404', 'order article not found in open orders' do response '404', 'order article not found in open orders' do
schema type: :object, properties: { schema type: :object, properties: {
group_order_article: { group_order_article: {
type: :object, '$ref': '#/components/schemas/GroupOrderArticle'
items: {
'$ref': '#/components/schemas/GroupOrderArticle'
}
} }
} }
let(:id) { 'invalid' } let(:id) { 'invalid' }
run_test! run_test!
end end
# 422
response '422', 'invalid parameter value' do response '422', 'invalid parameter value' do
let(:group_order_article) { { order_article_id: 'invalid', quantity: -5, tolerance: 'invalid' } } let(:group_order_article) { { order_article_id: 'invalid', quantity: -5, tolerance: 'invalid' } }
schema '$ref' => '#/components/schemas/Error422' schema '$ref' => '#/components/schemas/Error422'
@ -180,10 +172,7 @@ describe 'User', type: :request do
response '200', 'success' do response '200', 'success' do
schema type: :object, properties: { schema type: :object, properties: {
group_order_article: { group_order_article: {
type: :object, '$ref': '#/components/schemas/GroupOrderArticle'
items: {
'$ref': '#/components/schemas/GroupOrderArticle'
}
} }
} }
let(:id) { goa.id } let(:id) { goa.id }
@ -192,7 +181,6 @@ describe 'User', type: :request do
it_handles_invalid_token_with_id it_handles_invalid_token_with_id
# 403
response 403, 'user has no ordergroup, order not open, is below minimum balance, has not enough apple points, or missing scope' do response 403, 'user has no ordergroup, order not open, is below minimum balance, has not enough apple points, or missing scope' do
let(:api_scopes) { ['none'] } let(:api_scopes) { ['none'] }
schema '$ref' => '#/components/schemas/Error403' schema '$ref' => '#/components/schemas/Error403'