Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
parsing request params on get
  • Loading branch information
guilhermesilveira committed Oct 21, 2010
1 parent ca402ee commit cc074ab
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 15 deletions.
2 changes: 1 addition & 1 deletion lib/restfulie/client/feature/base.rb
Expand Up @@ -36,7 +36,7 @@ def with(headers)

# Path (e.g. http://restfulie.com/posts => /posts)
def path
host.path
host.path + (host.query.nil? ? "" : "?#{host.query}")
end

def host=(host)
Expand Down
14 changes: 0 additions & 14 deletions tests/spec/requests/http/builder_spec.rb

This file was deleted.

19 changes: 19 additions & 0 deletions tests/spec/requests/http/parameters_spec.rb
@@ -0,0 +1,19 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

class Object
def debug
debugger
self
end
end

context Restfulie do

it "should accept parameters in get requests" do
result = Restfulie.at('http://localhost:4567/request_with_querystring').debug.get(:foo => "bar", :bar => "foo")
params = JSON.parse(result.body)
params["foo"].should == "bar"
params["bar"].should == "foo"
end

end

0 comments on commit cc074ab

Please sign in to comment.