summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2012-12-14 08:14:05 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2012-12-14 08:14:05 +0300
commitb01f8b63c2c13f8d6b9111771fb4f1422214d91c (patch)
tree47c03ab168a7d34808493c366312194859459d46 /spec
parent44209861e8a3ed4e5d0e0e59823d4bf61c338f1f (diff)
downloadgitlab-ce-b01f8b63c2c13f8d6b9111771fb4f1422214d91c.tar.gz
added NamespacedProject role. Extended project info displayed for admin. Fixed project limit
Diffstat (limited to 'spec')
-rw-r--r--spec/models/user_spec.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb
index 279e315b693..79ffc05bca9 100644
--- a/spec/models/user_spec.rb
+++ b/spec/models/user_spec.rb
@@ -41,7 +41,6 @@ describe User do
it { should have_many(:users_projects).dependent(:destroy) }
it { should have_many(:projects) }
it { should have_many(:groups) }
- it { should have_many(:my_own_projects).class_name('Project') }
it { should have_many(:keys).dependent(:destroy) }
it { should have_many(:events).class_name('Event').dependent(:destroy) }
it { should have_many(:recent_events).class_name('Event') }
@@ -116,4 +115,16 @@ describe User do
user.authentication_token.should_not be_blank
end
end
+
+ describe 'projects and namespaces' do
+ before do
+ ActiveRecord::Base.observers.enable(:user_observer)
+ @user = create :user
+ @project = create :project, namespace: @user.namespace
+ end
+
+ it { @user.authorized_projects.should include(@project) }
+ it { @user.my_own_projects.should include(@project) }
+ it { @user.several_namespaces?.should be_false }
+ end
end