user = User.last
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
it "should create user with valid data" do
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
it "should not apply defaults to user" do
user.projects_limit.should == 10
user.can_create_group.should == true
- user.can_create_team.should == true
end
end
it "should apply defaults to user" do
user.projects_limit.should == 42
user.can_create_group.should == false
- user.can_create_team.should == false
end
end
end