summaryrefslogtreecommitdiffstats
path: root/app/user_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'app/user_test.go')
-rw-r--r--app/user_test.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/app/user_test.go b/app/user_test.go
index d9f40a604..3a924dfa7 100644
--- a/app/user_test.go
+++ b/app/user_test.go
@@ -137,6 +137,25 @@ func TestCreateProfileImage(t *testing.T) {
}
}
+func TestUpdateUserToRestrictedDomain(t *testing.T) {
+ th := Setup()
+ defer th.TearDown()
+
+ user := th.CreateUser()
+ defer th.App.PermanentDeleteUser(user)
+
+ th.App.UpdateConfig(func(cfg *model.Config) {
+ cfg.TeamSettings.RestrictCreationToDomains = "foo.com"
+ })
+
+ _, err := th.App.UpdateUser(user, false)
+ assert.True(t, err == nil)
+
+ user.Email = "asdf@ghjk.l"
+ _, err = th.App.UpdateUser(user, false)
+ assert.False(t, err == nil)
+}
+
func TestUpdateOAuthUserAttrs(t *testing.T) {
th := Setup()
defer th.TearDown()