1
0
Fork 0
mirror of https://github.com/jnunemaker/httparty synced 2023-03-27 23:23:07 -04:00
httparty/features/steps/httparty_steps.rb
Don Petersen 2febfe3c83 Cucumber features and steps for most functionality as of the 0.2.8
version.  No features for the CLI yet.

Signed-off-by: John Nunemaker <nunemaker@gmail.com>
2009-01-29 17:12:03 +08:00

15 lines
500 B
Ruby

When /I call HTTParty#get with '(.*)'$/ do |url|
begin
@response_from_httparty = HTTParty.get("http://#{@host_and_port}#{url}")
rescue HTTParty::RedirectionTooDeep => e
@exception_from_httparty = e
end
end
When /I call HTTParty#get with '(.*)' and a basic_auth hash:/ do |url, auth_table|
h = auth_table.hashes.first
@response_from_httparty = HTTParty.get(
"http://#{@host_and_port}#{url}",
:basic_auth => { :username => h["username"], :password => h["password"] }
)
end