From 8ef847030ec07f17f740c75fe44303b715cb1859 Mon Sep 17 00:00:00 2001 From: Ben Mills Date: Fri, 5 Dec 2014 17:16:07 -0700 Subject: [PATCH] Fix some errors --- features/reversals.feature | 7 ++++--- features/step_definitions/account.rb | 3 ++- features/step_definitions/customers.rb | 1 + fixtures/reversals.json | 1 - 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/features/reversals.feature b/features/reversals.feature index cb87965..c07a918 100644 --- a/features/reversals.feature +++ b/features/reversals.feature @@ -179,12 +179,13 @@ Feature: Reversal Scenario: Reverse an Account credit after settlement Given I have an Account with sufficient funds - When I make a POST request to the link "accounts.settlements" with the body: + When I POST to /accounts/:customer_payable_account_id/settlements with the body: + """ { "settlements": [{ "description": "Batch A", - "destination": /bank_accounts/:bank_account_id + "funding_instrument": /bank_accounts/:bank_account_id }] } """ @@ -209,7 +210,7 @@ Feature: Reversal } """ - When I make a POST request to the link "accounts.settlements" + When POST to /accounts/:customer_payable_account_id/settlements Then I should get a 201 Created status code And the response is valid according to the "settlements" schema diff --git a/features/step_definitions/account.rb b/features/step_definitions/account.rb index 9fa9f42..bcaf0e3 100644 --- a/features/step_definitions/account.rb +++ b/features/step_definitions/account.rb @@ -1,9 +1,10 @@ Given(/^I have an Account with sufficient funds$/) do step 'I have a merchant with 3 orders with debits' 3.times do |i| + order_href = "/orders/" + instance_variable_get("@order_id_#{i + 1}") @client.post("/accounts/#{@customer_payable_account_id}/credits", { amount: 10000, - order: "/orders/" + instance_variable_get("@order_id_#{i}") + order: order_href }) @client.add_hydrate "credit_id_#{i}".to_sym, @client['id'] end diff --git a/features/step_definitions/customers.rb b/features/step_definitions/customers.rb index bd01cb6..05358c4 100644 --- a/features/step_definitions/customers.rb +++ b/features/step_definitions/customers.rb @@ -17,6 +17,7 @@ @accounts.each do |acct| if acct['type'] == 'payable' @client.add_hydrate :customer_payable_account_id, acct['id'] + @customer_payable_account_id = acct['id'] break end end diff --git a/fixtures/reversals.json b/fixtures/reversals.json index 519c0d2..93f1ae7 100644 --- a/fixtures/reversals.json +++ b/fixtures/reversals.json @@ -27,7 +27,6 @@ "required": [ "reversals.credit", "reversals.order", - "reversals.source", "reversals.events" ] },