test/test_user.rb in leancloud-ruby-client-0.1.1 vs test/test_user.rb in leancloud-ruby-client-0.2.0
- old
+ new
@@ -1,20 +1,20 @@
require 'helper'
-class TestUser < AVTestCase
+class TestUser < LCTestCase
def test_user_save
VCR.use_cassette('test_user_save', :record => :new_episodes) do
username = rand.to_s
data = {
:username => username,
:password => "topsecret"
}
- user = AV::User.new data
+ user = LC::User.new data
user.save
- assert_equal user[AV::Protocol::KEY_OBJECT_ID].class, String
- assert_equal user[AV::Protocol::KEY_CREATED_AT].class, String
+ assert_equal user[LC::Protocol::KEY_OBJECT_ID].class, String
+ assert_equal user[LC::Protocol::KEY_CREATED_AT].class, String
end
end
def test_user_login
#VCR.use_cassette('test_user_login', :record => :new_episodes) do
@@ -22,18 +22,18 @@
data = {
:username => u,
:password => "secret"
}
- user = AV::User.new(data)
+ user = LC::User.new(data)
user.save
assert_equal user["username"], u
- assert_equal user[AV::Protocol::KEY_USER_SESSION_TOKEN].class, String
+ assert_equal user[LC::Protocol::KEY_USER_SESSION_TOKEN].class, String
- login = AV::User.authenticate(u, "secret")
+ login = LC::User.authenticate(u, "secret")
assert_equal login["username"], user["username"]
assert_equal login["sessionToken"].class, String
user = user.pointer.get
@@ -46,14 +46,14 @@
data = {
:username => u,
:password => "secret"
}
- user = AV::User.new(data)
+ user = LC::User.new(data)
user.save
- reset_password = AV::User.reset_password(u)
+ reset_password = LC::User.reset_password(u)
assert_equal Hash.new, reset_password
end
end