Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed User::authenticate

  • Loading branch information...
commit 20e11922c555567bd4198939b64c9849ad911687 1 parent be0da1d
@adelevie authored
Showing with 6 additions and 3 deletions.
  1. +2 −1  lib/parse/user.rb
  2. +4 −2 test/test_user.rb
View
3  lib/parse/user.rb
@@ -11,7 +11,8 @@ def self.authenticate(username, password)
"username" => username,
"password" => password
}
- response = Parse.client.request(Parse::Protocol::USER_LOGIN_URI, :get, body)
+
+ response = Parse.client.request(Parse::Protocol::USER_LOGIN_URI, :get, nil, body)
new(response)
end
View
6 test/test_user.rb
@@ -24,7 +24,9 @@ def test_login
:username => u,
:password => "secret"
}
+
user = Parse::User.new(data)
+
user.save
assert_equal user["username"], u
@@ -32,8 +34,8 @@ def test_login
login = Parse::User.authenticate(u, "secret")
- #assert_equal login["username"], "alan123"
- #assert_equal login["sessionToken"].class, String
+ assert_equal login["username"], user["username"]
+ assert_equal login["sessionToken"].class, String
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.