Skip to content

Instantly share code, notes, and snippets.

@swilk
Created December 23, 2009 22:02
Show Gist options
  • Save swilk/262848 to your computer and use it in GitHub Desktop.
Save swilk/262848 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'httparty'
require 'json'
class APItest
include HTTParty
format :json
base_uri 'http://localhost:3000'
# def self.register email, invitation_token, first_name, last_name, password, agree
# post("/user", :body => [{'user[email]' => email}])
# end
def self.login(email, password)
@response = post("/session.json", :query => {'login[email]' => email, 'login[password]' => password})
end
end
p APItest.login('[email protected]', '123456')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment