Skip to content

Commit

Permalink
Merge pull request #176 from linkernetworks/johnlin/fix-user-restful-…
Browse files Browse the repository at this point in the history
…test

fix test
  • Loading branch information
John-Lin authored Jul 25, 2018
2 parents 741464d + 644c2b0 commit 75f7916
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/server/handler_user_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func (suite *UserTestSuite) TestCreateUser() {

// load data to check
retUser := entity.User{}
err = suite.session.FindOne(entity.UserCollectionName, bson.M{"_id": user.ID}, &retUser)
err = suite.session.FindOne(entity.UserCollectionName, bson.M{"email": user.Email}, &retUser)
suite.NoError(err)
suite.NotEqual("", retUser.ID)
suite.Equal(user.Username, retUser.Username)
Expand All @@ -93,7 +93,7 @@ func (suite *UserTestSuite) TestCreateUser() {
httpRequest.Header.Add("Content-Type", "application/json")
httpWriter = httptest.NewRecorder()
suite.wc.Dispatch(httpWriter, httpRequest)
assertResponseCode(suite.T(), http.StatusInternalServerError, httpWriter)
assertResponseCode(suite.T(), http.StatusConflict, httpWriter)
}

func (suite *UserTestSuite) TestCreateUserFail() {
Expand Down

0 comments on commit 75f7916

Please sign in to comment.