feat: fix issues

This commit is contained in:
Rogee
2025-05-26 12:25:55 +08:00
parent 51ed5685dc
commit d634e0175b
10 changed files with 43 additions and 17 deletions

View File

@@ -57,3 +57,20 @@ func (s *UsersTestSuite) Test_Create() {
So(user.ID, ShouldNotBeZeroValue)
})
}
func (s *UsersTestSuite) Test_Update() {
Convey("Test_Update", s.T(), func() {
user, err := UsersModel().GetByID(context.Background(), 1001)
So(err, ShouldBeNil)
So(user, ShouldNotBeNil)
user.Username = "TestUpdate"
err = user.Update(context.TODO())
So(err, ShouldBeNil)
updatedUser, err := UsersModel().GetByID(context.Background(), user.ID)
So(err, ShouldBeNil)
So(updatedUser, ShouldNotBeNil)
So(updatedUser.Username, ShouldEqual, "TestUpdate")
})
}