Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
陈曦
sub2api
Commits
d47580a1
Commit
d47580a1
authored
Apr 20, 2026
by
IanShaw027
Browse files
test: pin email signup defaults in register tests
parent
0353c387
Changes
1
Show whitespace changes
Inline
Side-by-side
backend/internal/service/auth_service_register_test.go
View file @
d47580a1
...
@@ -374,6 +374,7 @@ func TestAuthService_Register_Success(t *testing.T) {
...
@@ -374,6 +374,7 @@ func TestAuthService_Register_Success(t *testing.T) {
repo
:=
&
userRepoStub
{
nextID
:
5
}
repo
:=
&
userRepoStub
{
nextID
:
5
}
service
:=
newAuthService
(
repo
,
map
[
string
]
string
{
service
:=
newAuthService
(
repo
,
map
[
string
]
string
{
SettingKeyRegistrationEnabled
:
"true"
,
SettingKeyRegistrationEnabled
:
"true"
,
SettingKeyAuthSourceDefaultEmailGrantOnSignup
:
"false"
,
},
nil
)
},
nil
)
token
,
user
,
err
:=
service
.
Register
(
context
.
Background
(),
"user@test.com"
,
"password"
)
token
,
user
,
err
:=
service
.
Register
(
context
.
Background
(),
"user@test.com"
,
"password"
)
...
@@ -522,6 +523,7 @@ func TestAuthService_Register_AssignsDefaultSubscriptions(t *testing.T) {
...
@@ -522,6 +523,7 @@ func TestAuthService_Register_AssignsDefaultSubscriptions(t *testing.T) {
service
:=
newAuthService
(
repo
,
map
[
string
]
string
{
service
:=
newAuthService
(
repo
,
map
[
string
]
string
{
SettingKeyRegistrationEnabled
:
"true"
,
SettingKeyRegistrationEnabled
:
"true"
,
SettingKeyDefaultSubscriptions
:
`[{"group_id":11,"validity_days":30},{"group_id":12,"validity_days":7}]`
,
SettingKeyDefaultSubscriptions
:
`[{"group_id":11,"validity_days":30},{"group_id":12,"validity_days":7}]`
,
SettingKeyAuthSourceDefaultEmailGrantOnSignup
:
"false"
,
},
nil
)
},
nil
)
service
.
defaultSubAssigner
=
assigner
service
.
defaultSubAssigner
=
assigner
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment