Skip to content
Snippets Groups Projects
Commit 1c2be671 authored by Stephen Holdaway's avatar Stephen Holdaway Committed by Dmitriy Zaporozhets
Browse files

Fix several_namespaces? to work with multiple ownership of groups

parent ea55707b
No related branches found
No related tags found
1 merge request!4948CentOS 6.4 install GitLab 6 0 stable ssh Auth fail
Loading
Loading
@@ -319,7 +319,7 @@ class User < ActiveRecord::Base
end
 
def several_namespaces?
namespaces.many?
namespaces.many? || owned_groups.any?
end
 
def namespace_id
Loading
Loading
Loading
Loading
@@ -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)
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment