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
Hide whitespace changes
Inline
Side-by-side
backend/internal/service/auth_service_register_test.go
View file @
d47580a1
...
...
@@ -373,7 +373,8 @@ func TestAuthService_Register_CreateEmailExistsRace(t *testing.T) {
func
TestAuthService_Register_Success
(
t
*
testing
.
T
)
{
repo
:=
&
userRepoStub
{
nextID
:
5
}
service
:=
newAuthService
(
repo
,
map
[
string
]
string
{
SettingKeyRegistrationEnabled
:
"true"
,
SettingKeyRegistrationEnabled
:
"true"
,
SettingKeyAuthSourceDefaultEmailGrantOnSignup
:
"false"
,
},
nil
)
token
,
user
,
err
:=
service
.
Register
(
context
.
Background
(),
"user@test.com"
,
"password"
)
...
...
@@ -520,8 +521,9 @@ func TestAuthService_Register_AssignsDefaultSubscriptions(t *testing.T) {
repo
:=
&
userRepoStub
{
nextID
:
42
}
assigner
:=
&
defaultSubscriptionAssignerStub
{}
service
:=
newAuthService
(
repo
,
map
[
string
]
string
{
SettingKeyRegistrationEnabled
:
"true"
,
SettingKeyDefaultSubscriptions
:
`[{"group_id":11,"validity_days":30},{"group_id":12,"validity_days":7}]`
,
SettingKeyRegistrationEnabled
:
"true"
,
SettingKeyDefaultSubscriptions
:
`[{"group_id":11,"validity_days":30},{"group_id":12,"validity_days":7}]`
,
SettingKeyAuthSourceDefaultEmailGrantOnSignup
:
"false"
,
},
nil
)
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