feat: activity log producers
This commit is contained in:
1 parent
50b1649965
commit
e37a46a027
93 files changed
+3396
-440
No files matched your search
@@ -18,7 +18,7 @@ import (
|
||||
func newRegistrationStatusRouter(userRepo *mockUserRepo, mailRepo *mockMailRepo) (*chi.Mux, *useCases.CreateUserUseCase) {
|
||||
token := jwtauth.New("HS256", []byte("test-secret"), nil)
|
||||
hasher := &stubHasher{}
|
||||
createUseCase := useCases.NewCreateUserUseCase(userRepo, hasher, mailRepo, "https://cms.example.com")
|
||||
createUseCase := useCases.NewCreateUserUseCase(userRepo, hasher, mailRepo, "https://cms.example.com", discardRecorder)
|
||||
loginHandler := auth.NewLoginHandler(token, createUseCase, useCases.NewAuthenticateUserUseCase(userRepo, hasher, discardRecorder), true)
|
||||
|
||||
r := chi.NewRouter()
|
||||
@@ -162,13 +162,13 @@ func TestRegistrationStatusEndpointHttp(t *testing.T) {
|
||||
userRepo.users[1] = user.User{ID: 1, Username: "alice", Email: "alice@example.com", IsVerified: true}
|
||||
userRepo.nextID = 1
|
||||
mailRepo := newMockMailRepo()
|
||||
uc := useCases.NewCreateUserUseCase(userRepo, &stubHasher{}, mailRepo, "https://cms.example.com")
|
||||
uc := useCases.NewCreateUserUseCase(userRepo, &stubHasher{}, mailRepo, "https://cms.example.com", discardRecorder)
|
||||
|
||||
if uc.IsRegistrationOpen() {
|
||||
t.Fatalf("expected IsRegistrationOpen to return false")
|
||||
}
|
||||
|
||||
_, err := uc.CreateUser(useCases.CreateUserCommand{
|
||||
_, err := uc.CreateUser(testCtx, useCases.CreateUserCommand{
|
||||
Username: "bob",
|
||||
Password: "hunter2example12",
|
||||
Email: "bob@example.com",
|
||||
|
||||
Reference in new issue
Block a user