28_introduce_rswag #35
4 changed files with 10 additions and 8 deletions
|
@ -46,7 +46,7 @@ describe 'Order Articles', type: :request do
|
|||
end
|
||||
end
|
||||
|
||||
describe 'supplier' do
|
||||
describe 'when ordered by supplier' do
|
||||
let(:q) { { q: { ordered: 'supplier' } } }
|
||||
|
||||
run_test! do |response|
|
||||
|
@ -56,7 +56,7 @@ describe 'Order Articles', type: :request do
|
|||
end
|
||||
end
|
||||
|
||||
describe 'member' do
|
||||
describe 'when ordered by member' do
|
||||
let(:q) { { q: { ordered: 'member' } } }
|
||||
|
||||
run_test! do |response|
|
||||
|
|
|
@ -91,10 +91,7 @@ describe 'User', type: :request do
|
|||
response '200', 'success' do
|
||||
schema type: :object, properties: {
|
||||
financial_transaction: {
|
||||
type: :object,
|
||||
items: {
|
||||
'$ref': '#/components/schemas/FinancialTransaction'
|
||||
}
|
||||
'$ref': '#/components/schemas/FinancialTransaction'
|
||||
}
|
||||
}
|
||||
let(:id) { ft.id }
|
||||
|
|
|
@ -53,6 +53,7 @@ describe 'User', type: :request do
|
|||
tags 'User', 'Financial Transaction'
|
||||
produces 'application/json'
|
||||
let(:user) { create :user, :ordergroup }
|
||||
let(:api_scopes) { ['finance:user'] }
|
||||
FinancialTransactionClass.create(name: 'TestTransaction')
|
||||
|
||||
response 200, 'success' do
|
||||
|
@ -93,7 +94,6 @@ describe 'User', type: :request do
|
|||
}
|
||||
}
|
||||
|
||||
let(:api_scopes) { ['finance:user'] }
|
||||
run_test!
|
||||
end
|
||||
|
||||
|
|
|
@ -79,7 +79,12 @@ module ApiHelper
|
|||
def self.q_ordered_url_param
|
||||
parameter name: :q, in: :query, required: false,
|
||||
description: "'member' show articles ordered by the user's ordergroup, 'all' by all members, and 'supplier' ordered at the supplier",
|
||||
schema: { '$ref' => '#/components/schemas/q_ordered' }
|
||||
schema: {
|
||||
type: :object,
|
||||
properties: {
|
||||
ordered: { '$ref' => '#/components/schemas/q_ordered' }
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue