Commit e19526c2ac3e6a8ae62934c09ac70219062c818a
1 parent
c7cb7599
Exists in
master
and in
4 other branches
Fix several_namespaces? to work with multiple ownership of groups
Showing
2 changed files
with
14 additions
and
1 deletions
Show diff stats
app/models/user.rb
spec/models/user_spec.rb
... | ... | @@ -139,6 +139,19 @@ describe User do |
139 | 139 | it { @user.owned_groups.should == [@group] } |
140 | 140 | end |
141 | 141 | |
142 | + describe 'group multiple owners' do | |
143 | + before do | |
144 | + ActiveRecord::Base.observers.enable(:user_observer) | |
145 | + @user = create :user | |
146 | + @user2 = create :user | |
147 | + @group = create :group, owner: @user | |
148 | + | |
149 | + @group.add_users([@user2.id], UsersGroup::OWNER) | |
150 | + end | |
151 | + | |
152 | + it { @user2.several_namespaces?.should be_true } | |
153 | + end | |
154 | + | |
142 | 155 | describe 'namespaced' do |
143 | 156 | before do |
144 | 157 | ActiveRecord::Base.observers.enable(:user_observer) | ... | ... |