summaryrefslogtreecommitdiff
path: root/spec/models
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com>2011-12-07 10:04:57 +0200
committerDmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com>2011-12-07 10:04:57 +0200
commit1b8f082061e3f120ab02b263cb68e3433b028ef6 (patch)
tree8c4dd949e79b9b04f0d53e3b17f13b06ae2d6385 /spec/models
parent68154e8fe9d6266f3b1ae00e48530143f87cd138 (diff)
downloadgitlab-ce-1b8f082061e3f120ab02b263cb68e3433b028ef6.tar.gz
new access rights implemented
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/note_spec.rb18
1 files changed, 9 insertions, 9 deletions
diff --git a/spec/models/note_spec.rb b/spec/models/note_spec.rb
index bd3f3934aec..ce7488dbb8d 100644
--- a/spec/models/note_spec.rb
+++ b/spec/models/note_spec.rb
@@ -31,9 +31,9 @@ describe Note do
describe :read do
before do
- @p1.users_projects.create(:user => @u1, :read => false)
- @p1.users_projects.create(:user => @u2, :read => true)
- @p2.users_projects.create(:user => @u3, :read => true)
+ @p1.users_projects.create(:user => @u1, :project_access => Project::PROJECT_N)
+ @p1.users_projects.create(:user => @u2, :project_access => Project::PROJECT_R)
+ @p2.users_projects.create(:user => @u3, :project_access => Project::PROJECT_R)
end
it { @abilities.allowed?(@u1, :read_note, @p1).should be_false }
@@ -43,9 +43,9 @@ describe Note do
describe :write do
before do
- @p1.users_projects.create(:user => @u1, :write => false)
- @p1.users_projects.create(:user => @u2, :write => true)
- @p2.users_projects.create(:user => @u3, :write => true)
+ @p1.users_projects.create(:user => @u1, :project_access => Project::PROJECT_R)
+ @p1.users_projects.create(:user => @u2, :project_access => Project::PROJECT_RW)
+ @p2.users_projects.create(:user => @u3, :project_access => Project::PROJECT_RW)
end
it { @abilities.allowed?(@u1, :write_note, @p1).should be_false }
@@ -55,9 +55,9 @@ describe Note do
describe :admin do
before do
- @p1.users_projects.create(:user => @u1, :admin => false)
- @p1.users_projects.create(:user => @u2, :admin => true)
- @p2.users_projects.create(:user => @u3, :admin => true)
+ @p1.users_projects.create(:user => @u1, :project_access => Project::PROJECT_R)
+ @p1.users_projects.create(:user => @u2, :project_access => Project::PROJECT_RWA)
+ @p2.users_projects.create(:user => @u3, :project_access => Project::PROJECT_RWA)
end
it { @abilities.allowed?(@u1, :admin_note, @p1).should be_false }