From 619fdbe958ea029f1745844bd95959f9dcbdf4e0 Mon Sep 17 00:00:00 2001 From: Philipp Rothmann Date: Mon, 2 Jan 2023 13:05:43 +0100 Subject: [PATCH] fix: minor foo --- spec/requests/api/order_articles_spec.rb | 4 ++-- spec/requests/api/user/financial_transactions_spec.rb | 5 +---- spec/requests/api/user/users_spec.rb | 2 +- spec/support/api_helper.rb | 7 ++++++- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/spec/requests/api/order_articles_spec.rb b/spec/requests/api/order_articles_spec.rb index 2285fff6..e0c8c651 100644 --- a/spec/requests/api/order_articles_spec.rb +++ b/spec/requests/api/order_articles_spec.rb @@ -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| diff --git a/spec/requests/api/user/financial_transactions_spec.rb b/spec/requests/api/user/financial_transactions_spec.rb index 6bbcda47..4225e1ac 100644 --- a/spec/requests/api/user/financial_transactions_spec.rb +++ b/spec/requests/api/user/financial_transactions_spec.rb @@ -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 } diff --git a/spec/requests/api/user/users_spec.rb b/spec/requests/api/user/users_spec.rb index 01031180..0d3196bc 100644 --- a/spec/requests/api/user/users_spec.rb +++ b/spec/requests/api/user/users_spec.rb @@ -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 diff --git a/spec/support/api_helper.rb b/spec/support/api_helper.rb index 25576754..86e2ca07 100644 --- a/spec/support/api_helper.rb +++ b/spec/support/api_helper.rb @@ -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