diff options
author | Dmitry Medvinsky <me@dmedvinsky.name> | 2013-03-11 10:44:45 +0400 |
---|---|---|
committer | Dmitry Medvinsky <me@dmedvinsky.name> | 2013-05-16 18:02:22 +0400 |
commit | 22279bc55870435c61d5e8208cc3117ef2268052 (patch) | |
tree | 1433f090b459f8573619121533546de8c2b32a02 /spec/lib | |
parent | 3e115faafa13a0bcad5458a9632dec909eb376da (diff) |
Add settings for user permission defaults
“Can create groups” and “Can create teams” had hardcoded defaults to
`true`. Sometimes it is desirable to prohibit these for newly created
users by default.
Diffstat (limited to 'spec/lib')
-rw-r--r-- | spec/lib/auth_spec.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/lib/auth_spec.rb b/spec/lib/auth_spec.rb index 1e03bc591b4..a7ce97554ea 100644 --- a/spec/lib/auth_spec.rb +++ b/spec/lib/auth_spec.rb @@ -91,5 +91,15 @@ describe Gitlab::Auth do user.extern_uid.should == @info.uid user.provider.should == 'twitter' end + + it "should apply defaults to user" do + @auth = mock(info: @info, provider: 'ldap') + user = gl_auth.create_from_omniauth(@auth, true) + + user.should be_valid + user.projects_limit.should == Gitlab.config.gitlab.default_projects_limit + user.can_create_group.should == Gitlab.config.gitlab.default_can_create_group + user.can_create_team.should == Gitlab.config.gitlab.default_can_create_team + end end end |