From 913136bb72ad41b04c8e893058d39b4b95d2440d Mon Sep 17 00:00:00 2001 From: Philipp Rothmann Date: Sat, 17 Jun 2023 13:30:07 +0200 Subject: [PATCH] fix: invalid params request test fixes #999 --- spec/requests/api/v1/user/financial_transactions_spec.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/spec/requests/api/v1/user/financial_transactions_spec.rb b/spec/requests/api/v1/user/financial_transactions_spec.rb index 63603d66..c37d5b22 100644 --- a/spec/requests/api/v1/user/financial_transactions_spec.rb +++ b/spec/requests/api/v1/user/financial_transactions_spec.rb @@ -48,10 +48,9 @@ describe 'User' do end response '422', 'invalid parameter value' do - xit 'TODO: fix controller to actually send a 422 for invalid params: https://github.com/foodcoops/foodsoft/issues/999' - # schema '$ref' => '#/components/schemas/Error422' - # let(:financial_transaction) { { amount: -3, financial_transaction_type_id: create(:financial_transaction_type).id, note: -2 } } - # run_test! + schema '$ref' => '#/components/schemas/Error422' + let(:financial_transaction) { { amount: "abc", financial_transaction_type_id: create(:financial_transaction_type).id, note: "foo bar" } } + run_test! end end