diff options
author | Stephen Holdaway <stecman@gmail.com> | 2013-09-12 00:10:45 +1200 |
---|---|---|
committer | Stephen Holdaway <stecman@gmail.com> | 2013-09-12 00:10:45 +1200 |
commit | e19526c2ac3e6a8ae62934c09ac70219062c818a (patch) | |
tree | 06bd1b6bff49d57bbb28b38e95016b86b4c54324 /spec | |
parent | c7cb7599e23a37f3ff97522a43bbd97222d86774 (diff) | |
download | gitlab-ce-e19526c2ac3e6a8ae62934c09ac70219062c818a.tar.gz |
Fix several_namespaces? to work with multiple ownership of groups
Diffstat (limited to 'spec')
-rw-r--r-- | spec/models/user_spec.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index de06bf71dc1..d79d2b82b6a 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -139,6 +139,19 @@ describe User do it { @user.owned_groups.should == [@group] } end + describe 'group multiple owners' do + before do + ActiveRecord::Base.observers.enable(:user_observer) + @user = create :user + @user2 = create :user + @group = create :group, owner: @user + + @group.add_users([@user2.id], UsersGroup::OWNER) + end + + it { @user2.several_namespaces?.should be_true } + end + describe 'namespaced' do before do ActiveRecord::Base.observers.enable(:user_observer) |