Skip to content

Commit

Permalink
fixing forms description for the docs and external account fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewfl committed Mar 4, 2014
1 parent 013f37a commit 2d8bfa2
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 7 deletions.
1 change: 0 additions & 1 deletion features/credit_cards.feature
Expand Up @@ -247,7 +247,6 @@ Feature: Credit cards
}
"""

@failing
Scenario: Retrieving a card
Given I have tokenized a card
When I make a GET request to /cards/:card_id
Expand Down
6 changes: 4 additions & 2 deletions features/external_accounts.feature
Expand Up @@ -13,7 +13,7 @@ Feature: External accounts
Then I should get a 201 Created status code
And the response is valid according to the "external_account_tokens" schema

When I GET /external_accounts/:external_account_id
When I GET "external_accounts.href" from the previous response
Then I should get a 200 OK status code
And the response is valid according to the "external_accounts" schema

Expand All @@ -31,7 +31,7 @@ Feature: External accounts

Scenario: Unstore an external account
Given I have tokenized an external account
When I DELETE to /external_accounts/:external_accounts_id
When I DELETE to /external_accounts/:external_account_id
Then I should get a 204 OK status code
And there should be no response body

Expand All @@ -46,7 +46,9 @@ Feature: External accounts
Then I should get a 201 Created status code
And the response is valid according to the "debits" schema

@failing
Scenario: Add an external account to a customer
# the patch permission has an issue with external accounts
Given I have created a customer
And I have tokenized an external account
When I make a PATCH request to the href "href" with the body:
Expand Down
17 changes: 17 additions & 0 deletions features/rest/callbacks.feature
Expand Up @@ -36,6 +36,23 @@ Feature: Callbacks
{ "category_code": "duplicate-webhook-url" }
"""

Scenario: Create a callback using GET method
When I POST to /callbacks with the JSON API body:
"""
{
"url": "http://www.example.com/callback",
"method": "get"
}
"""
Then I should get a 201 Created status code
And the response is valid according to the "callbacks" schema
And the fields on this callback match:
"""
{
"method": "get"
}
"""

Scenario: List all callbacks
You can only have one callback, but if you don't know the ID,
getting the list makes sense. It'll just only have one.
Expand Down
12 changes: 10 additions & 2 deletions features/rest/debits.feature
Expand Up @@ -42,7 +42,11 @@ Feature: Debit a card or bank account
When I POST to /customers/:customer_id/debits with the JSON API body:
"""
{
"amount": 2000
"amount": 2000,
"meta": {
"product_id": "123123123"
},
"description": "Bob is giving me some $$$"
}
"""
Then I should get a 201 Created status code
Expand All @@ -53,7 +57,11 @@ Feature: Debit a card or bank account
"amount": 2000,
"links": {
"customer": ":customer_id"
}
},
"meta": {
"product_id": "123123123"
},
"description": "Bob is giving me some $$$"
}
"""

Expand Down
2 changes: 1 addition & 1 deletion features/step_definitions/external_accounts.rb
@@ -1,7 +1,7 @@
Given(/^I have an external account$/) do
@client.post('/external_accounts', {
token: '123123',
network: 'test'
provider: 'test'
})
@external_account_id = @client['id']
@client.add_hydrate :external_account_id, @external_account_id
Expand Down
6 changes: 5 additions & 1 deletion fixtures/_models/callback.json
Expand Up @@ -16,7 +16,11 @@
},
"method": {
"type": "string",
"pattern": "post"
"enum": [
"post",
"put",
"get"
]
},
"revision": {
"type": "string",
Expand Down

0 comments on commit 2d8bfa2

Please sign in to comment.