Skip to content

Commit

Permalink
start changing over to hydrater
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewfl authored and steveklabnik committed Dec 18, 2013
1 parent 1e61843 commit bbb2eff
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion features/cards.feature
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ Feature: Tokenize a credit card

Scenario: Remove a card
Given I have tokenized a card
When I DELETE to /cards/:card_id giving the card_id
When I DELETE to /cards/:card_id
Then I should get a 204 OK status code
And there should be no response body
27 changes: 14 additions & 13 deletions features/step_definitions/cards.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,17 @@
@client.get("/cards/#{@card_id}")
end

When(/^I DELETE to \/cards\/:card_id giving the card_id$/) do
options = {
headers: {
"Accept" => $accept_header,
},
basic_auth: {
username: $api_secret,
password: "",
}
}
response = HTTParty.delete("#{@client.root_url}/cards/#{@card_id}", options)
@client.add_response(response)
end
# When(/^I DELETE to \/cards\/:card_id giving the card_id$/) do
# @client.delete(
# # options = {
# # headers: {
# # "Accept" => $accept_header,
# # },
# # basic_auth: {
# # username: $api_secret,
# # password: "",
# # }
# # }
# # response = HTTParty.delete("#{@client.root_url}/cards/#{@card_id}", options)
# # @client.add_response(response)
# end
2 changes: 1 addition & 1 deletion features/step_definitions/http_steps.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
When(/^I (\w+) to (\/\S*?)$/) do |verb, url|
@client.verb(verb, url)
@client.verb(verb, @client.hydrater(url))
end

When(/^I POST to (\/\S*) without my secret key with the JSON API body:$/) do |url, body|
Expand Down

0 comments on commit bbb2eff

Please sign in to comment.