Skip to content

Commit

Permalink
Make progress on 'transactions inherit descriptions'
Browse files Browse the repository at this point in the history
  • Loading branch information
steveklabnik committed Jan 11, 2014
1 parent 585f67f commit 48ec874
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
19 changes: 12 additions & 7 deletions features/orders.feature
Original file line number Diff line number Diff line change
Expand Up @@ -172,21 +172,24 @@ Feature: Orders
}
"""

@failing
@failing @gh-469
Scenario: Transactions should inherit the description of the order by default
Given I have tokenized a bank account
When I make a POST request to the link "customers.orders" with the body:
Given I have created an order
And I have tokenized a bank account
When I fetch the customer
And I make a POST request to the link "customers.orders" with the body:
"""
{
"description": "Beats by Dr. Dre" }
"description": "Beats by Dr. Dre"
}
"""

Then I should get a 201 Created status code
And the response is valid according to the "orders" schema
And the fields on this order match:
"""
{
{ "description": "Beats by Dr. Dre" }
"description": "Beats by Dr. Dre"
}
"""

Expand All @@ -200,9 +203,10 @@ Feature: Orders

Then I should get a 201 Created status code
And the response is valid according to the "debits" schema
And the fields on this debit match:
"""
{
"description": "Beats by Dr. Dre" }
"description": "Beats by Dr. Dre"
}
"""

Expand All @@ -214,7 +218,8 @@ Feature: Orders
}
"""
Then I should get a 201 Created status code
And the response is valid according to the "debits" schema
And the response is valid according to the "credits" schema
And the fields on this credit match:
"""
{
{ "description": "Beats by Dr. Dre"}
Expand Down
5 changes: 5 additions & 0 deletions features/step_definitions/http_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ def env
step %Q{I make a #{verb} request to the link "#{keys}"}
end

When(/^I fetch the (\w+)$/) do |resource|
id = instance_variable_get("@#{resource}_id")
@client.get("/resources/#{id}")
end

When(/^I make a (\w+) request to the link "(.*?)"$/) do |verb, keys|
$logger.debug("Requesting hydrated: #{@client.hydrater(@client.last_body["links"][keys])}")
body = @client.send(verb.downcase, @client.hydrater(@client.last_body["links"][keys]), {}, env)
Expand Down

0 comments on commit 48ec874

Please sign in to comment.