Permalink
Browse files

Use query instead of body for posts. Closes #5

  • Loading branch information...
therabidbanana committed Apr 15, 2012
1 parent 5ae7055 commit 92a701e363ea372f6e2454058e7643c727d1bb88
Showing with 4 additions and 4 deletions.
  1. +1 −1 lib/eventbrite/main.rb
  2. +1 −1 spec/eventbrite/user_spec.rb
  3. +2 −2 spec/eventbrite_spec.rb
View
@@ -25,7 +25,7 @@ def self.call(function, opts = {})
opts.merge!(u.auth)
end
debug "\tSending /#{function}\t\t(#{opts.inspect})"
- response = API.do_post("/#{function}", :body => opts)
+ response = API.do_post("/#{function}", :query => opts)
debug "\tResponse /#{function}\t\t#{response.inspect}"
response
end
@@ -19,7 +19,7 @@
end
it "should accept an array of [email, password] as authentication" do
- Eventbrite::API.should_receive(:do_post).with("/user_get", :body => hash_including("password", "user")).and_return(fake_response("/user_get"))
+ Eventbrite::API.should_receive(:do_post).with("/user_get", :query => hash_including("password", "user")).and_return(fake_response("/user_get"))
u = Eventbrite::User.new(["fake_user", "fake_pass"])
u.attribute_get(:email).should_not be_nil
end
View
@@ -12,7 +12,7 @@
}.should_not raise_error
end
it "should call httparty with key given to setup" do
- Eventbrite::API.should_receive(:do_post).with(anything, hash_including(:body => hash_including(:app_key => "key")))
+ Eventbrite::API.should_receive(:do_post).with(anything, hash_including(:query => hash_including(:app_key => "key")))
Eventbrite.call("event_get", {})
end
@@ -24,7 +24,7 @@
end
it "should replace a user object with a user_key on #call" do
- Eventbrite::API.should_receive(:do_post).with("/user_get", {:body => {:app_key => "key", "user_key" => "fake_key"}})
+ Eventbrite::API.should_receive(:do_post).with("/user_get", {:query => {:app_key => "key", "user_key" => "fake_key"}})
Eventbrite.call(:user_get, :user => Eventbrite::User.new("fake_key", true))
end

0 comments on commit 92a701e

Please sign in to comment.