Skip to content

Commit

Permalink
test(grant): cleanup grants table after each test in grant repository…
Browse files Browse the repository at this point in the history
… test
  • Loading branch information
rahmatrhd committed Oct 9, 2023
1 parent 6330380 commit 3e541da
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions internal/store/postgres/grant_repository_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,17 @@ func (s *GrantRepositoryTestSuite) SetupSuite() {
s.Require().NoError(err)
}

func (s *GrantRepositoryTestSuite) AfterTest(suiteName, testName string) {
// clean grants table
db, err := s.store.DB().DB()
if err != nil {
s.T().Fatal(err)
}
if _, err := db.Exec("DELETE FROM grants"); err != nil {
s.T().Fatal(err)
}
}

func (s *GrantRepositoryTestSuite) TearDownSuite() {
// Clean tests
db, err := s.store.DB().DB()
Expand Down

0 comments on commit 3e541da

Please sign in to comment.