From 57593db96def6f4c18e866fc4c6cff5bfbbc8c14 Mon Sep 17 00:00:00 2001 From: Philipp Rothmann Date: Mon, 12 Dec 2022 15:15:35 +0100 Subject: [PATCH] refactor: order articles spec --- spec/requests/api/order_articles_spec.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/spec/requests/api/order_articles_spec.rb b/spec/requests/api/order_articles_spec.rb index 304869e3..50774110 100644 --- a/spec/requests/api/order_articles_spec.rb +++ b/spec/requests/api/order_articles_spec.rb @@ -9,15 +9,15 @@ describe 'Order Articles', type: :request do produces 'application/json' parameter name: "per_page", in: :query, type: :integer, required: false parameter name: "page", in: :query, type: :integer, required: false - let(:page) { 1 } - let(:per_page) { 10 } 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: { type: :object, - ordered: { - type: :string, - enum: %w[member all supplier] + properties: { + ordered: { + type: :string, + enum: %w[member all supplier] + } } } let(:api_scopes) { ['orders:read', 'orders:write'] } @@ -106,10 +106,7 @@ describe 'Order Articles', type: :request do tags 'Order' produces 'application/json' parameter name: 'id', in: :path, type: :integer, minimum: 1, required: true - let(:api_scopes) { ['orders:read', 'orders:write'] } - let(:order) { create(:order, article_count: 1) } - let(:id) { order.order_articles.first.id } response '200', 'success' do schema type: :object, properties: { @@ -117,11 +114,14 @@ describe 'Order Articles', type: :request do '$ref': '#/components/schemas/OrderArticle' } } + let(:order) { create(:order, article_count: 1) } + let(:id) { order.order_articles.first.id } run_test! end it_handles_invalid_token_and_scope + it_cannot_find_object 'order article not found' end end end