summaryrefslogtreecommitdiff
path: root/spec/models/event_spec.rb
diff options
context:
space:
mode:
authorValery Sizov <valery@gitlab.com>2016-10-04 15:52:08 +0300
committerValery Sizov <valery@gitlab.com>2016-10-11 16:51:26 +0300
commitb4004488f76d7360acd2f38277d617447c76b888 (patch)
treed52552cccf8b51ba4e099f0afbb05bf94a1a1472 /spec/models/event_spec.rb
parenta3169d522a0db269770141a1b30c3df5acee82f3 (diff)
downloadgitlab-ce-b4004488f76d7360acd2f38277d617447c76b888.tar.gz
Make guests unable to view MRsguests_cant_see_mrs
Diffstat (limited to 'spec/models/event_spec.rb')
-rw-r--r--spec/models/event_spec.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/models/event_spec.rb b/spec/models/event_spec.rb
index af5002487cc..06cac929bbf 100644
--- a/spec/models/event_spec.rb
+++ b/spec/models/event_spec.rb
@@ -135,6 +135,17 @@ describe Event, models: true do
it { expect(event.visible_to_user?(member)).to eq true }
it { expect(event.visible_to_user?(guest)).to eq true }
it { expect(event.visible_to_user?(admin)).to eq true }
+
+ context 'private project' do
+ let(:project) { create(:project, :private) }
+
+ it { expect(event.visible_to_user?(non_member)).to eq false }
+ it { expect(event.visible_to_user?(author)).to eq true }
+ it { expect(event.visible_to_user?(assignee)).to eq true }
+ it { expect(event.visible_to_user?(member)).to eq true }
+ it { expect(event.visible_to_user?(guest)).to eq false }
+ it { expect(event.visible_to_user?(admin)).to eq true }
+ end
end
end