Skip to content

Commit 62181f1

Browse files
committed
fix follow / unfollow user test case
1 parent 96dfc30 commit 62181f1

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

test/user.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ var email="u" + Date.now() + "@test.com";
33
var password="password1";
44
describe("User",function(){
55
this.timeout(10000);
6-
it("Signing up",function(done){
6+
it("should sign up",function(done){
77
var user = new AV.User();
88
user.set("username", username);
99
user.set("password", password);
@@ -15,7 +15,7 @@ describe("User",function(){
1515
user.signUp(null, {
1616
success: function(user) {
1717
debug(user);
18-
//expect(user.id).to.be.ok();
18+
expect(user.id).to.be.ok();
1919
done();
2020
// Hooray! Let them use the app now.
2121
},
@@ -48,7 +48,7 @@ describe("UserSignin",function(){
4848
});
4949

5050
describe("Current User",function(){
51-
it("return current",function(done){
51+
it("should return current user",function(done){
5252

5353
var currentUser = AV.User.current();
5454

@@ -58,7 +58,7 @@ describe("Current User",function(){
5858
});
5959

6060
describe("User update",function(){
61-
it("update name",function(done){
61+
it("shoud update name",function(done){
6262

6363
var user = AV.User.logIn(username, password, {
6464
success: function(user) {
@@ -93,7 +93,7 @@ describe("User update",function(){
9393
});
9494

9595
describe("Update user password", function() {
96-
it("update password",function(done){
96+
it("should update password",function(done){
9797
var user = AV.User.logIn(username, password, {
9898
success: function(user) {
9999
user.updatePassword(password, 'new pass').then(function(){
@@ -112,7 +112,7 @@ describe("Update user password", function() {
112112
});
113113

114114
describe("User query",function(){
115-
it("return conditoinal users",function(done){
115+
it("should return conditoinal users",function(done){
116116
var query = new AV.Query(AV.User);
117117
query.equalTo("gender", "female"); // find all the women
118118
query.find({
@@ -158,21 +158,21 @@ describe("Associations",function(){
158158
describe("Follow/unfollow users",function(){
159159
it("should follow/unfollow",function(done){
160160
var user = AV.User.current();
161-
user.follow('52f9be45e4b035debf88b6e2', {
161+
user.follow('53fb0fd6e4b074a0f883f08a', {
162162
success: function(){
163163
var query = user.followeeQuery();
164164
query.find({
165165
success: function(results){
166166
expect(results.length).to.be(1);
167167
debug(results);
168-
expect(results[0].id).to.be('52f9be45e4b035debf88b6e2');
169-
var followerQuery = AV.User.followerQuery('52f9be45e4b035debf88b6e2');
168+
expect(results[0].id).to.be('53fb0fd6e4b074a0f883f08a');
169+
var followerQuery = AV.User.followerQuery('53fb0fd6e4b074a0f883f08a');
170170
followerQuery.find().then(function(results){
171171
expect(results.length).to.be(1);
172172
debug(results);
173173
expect(results[0].id).to.be(user.id);
174174
//unfollow
175-
user.unfollow('52f9be45e4b035debf88b6e2').then(function(){
175+
user.unfollow('53fb0fd6e4b074a0f883f08a').then(function(){
176176
//query should be emtpy
177177
var query = user.followeeQuery();
178178
query.find({
@@ -195,8 +195,8 @@ describe("Follow/unfollow users",function(){
195195
}
196196
});
197197
},
198-
error: function(err){
199-
throw err;
198+
error: function(err) {
199+
done(err);
200200
}
201201
});
202202
});

0 commit comments

Comments
 (0)