@@ -206,7 +206,7 @@ describe('User', function() {
206206 const now = Date . now ( ) ;
207207 return AV . User . signUpOrlogInWithAuthDataAndUnionId (
208208 {
209- openid : 'openid1' + now ,
209+ uid : 'openid1' + now ,
210210 access_token : 'access_token' ,
211211 expires_in : 1382686496 ,
212212 } ,
@@ -218,7 +218,7 @@ describe('User', function() {
218218 ) . then ( user1 => {
219219 return AV . User . signUpOrlogInWithAuthDataAndUnionId (
220220 {
221- openid : 'openid2' + now ,
221+ uid : 'openid2' + now ,
222222 access_token : 'access_token' ,
223223 expires_in : 1382686496 ,
224224 } ,
@@ -234,15 +234,15 @@ describe('User', function() {
234234 describe ( 'associate with authData' , function ( ) {
235235 it ( 'logIn an user, and associate with authData' , function ( ) {
236236 var username = Date . now ( ) . toString ( 36 ) ;
237- var password = '123456' ;
238- var user = new AV . User ( ) ;
239- user . set ( 'username' , username ) ;
240- user . set ( 'password' , password ) ;
241- return user
242- . save ( )
243- . then ( function ( ) {
244- return AV . User . logIn ( username , password ) ;
245- } )
237+
238+ return AV . User . signUpOrlogInWithAuthData (
239+ {
240+ uid : 'zaabbbccc123123' + username ,
241+ access_token : 'a123123aaabbbbcccc' ,
242+ expires_in : 1382686496 ,
243+ } ,
244+ 'test'
245+ )
246246 . then ( function ( loginedUser ) {
247247 return AV . User . associateWithAuthData ( loginedUser , 'weixin' , {
248248 openid : 'aaabbbccc123123' + username ,
@@ -252,10 +252,12 @@ describe('User', function() {
252252 } )
253253 . then ( user => {
254254 user . get ( 'authData' ) . should . have . property ( 'weixin' ) ;
255+ user . get ( 'authData' ) . should . have . property ( 'test' ) ;
255256 return user . dissociateAuthData ( 'weixin' ) ;
256257 } )
257258 . then ( user => {
258259 user . get ( 'authData' ) . should . not . have . property ( 'weixin' ) ;
260+ user . get ( 'authData' ) . should . have . property ( 'test' ) ;
259261 } ) ;
260262 } ) ;
261263 } ) ;
0 commit comments