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
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'supplier' do
|
describe 'when ordered by supplier' do
|
||||||
let(:q) { { q: { ordered: 'supplier' } } }
|
let(:q) { { q: { ordered: 'supplier' } } }
|
||||||
|
|
||||||
run_test! do |response|
|
run_test! do |response|
|
||||||
|
@ -56,7 +56,7 @@ describe 'Order Articles', type: :request do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'member' do
|
describe 'when ordered by member' do
|
||||||
let(:q) { { q: { ordered: 'member' } } }
|
let(:q) { { q: { ordered: 'member' } } }
|
||||||
|
|
||||||
run_test! do |response|
|
run_test! do |response|
|
||||||
|
|
|
@ -91,10 +91,7 @@ describe 'User', type: :request do
|
||||||
response '200', 'success' do
|
response '200', 'success' do
|
||||||
schema type: :object, properties: {
|
schema type: :object, properties: {
|
||||||
financial_transaction: {
|
financial_transaction: {
|
||||||
type: :object,
|
'$ref': '#/components/schemas/FinancialTransaction'
|
||||||
items: {
|
|
||||||
'$ref': '#/components/schemas/FinancialTransaction'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let(:id) { ft.id }
|
let(:id) { ft.id }
|
||||||
|
|
|
@ -53,6 +53,7 @@ describe 'User', type: :request do
|
||||||
tags 'User', 'Financial Transaction'
|
tags 'User', 'Financial Transaction'
|
||||||
produces 'application/json'
|
produces 'application/json'
|
||||||
let(:user) { create :user, :ordergroup }
|
let(:user) { create :user, :ordergroup }
|
||||||
|
let(:api_scopes) { ['finance:user'] }
|
||||||
FinancialTransactionClass.create(name: 'TestTransaction')
|
FinancialTransactionClass.create(name: 'TestTransaction')
|
||||||
|
|
||||||
response 200, 'success' do
|
response 200, 'success' do
|
||||||
|
@ -93,7 +94,6 @@ describe 'User', type: :request do
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let(:api_scopes) { ['finance:user'] }
|
|
||||||
run_test!
|
run_test!
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -79,7 +79,12 @@ module ApiHelper
|
||||||
def self.q_ordered_url_param
|
def self.q_ordered_url_param
|
||||||
parameter name: :q, in: :query, required: false,
|
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",
|
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
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue