summaryrefslogtreecommitdiff
path: root/spec/models/project_spec.rb
diff options
context:
space:
mode:
authorAhmad Sherif <me@ahmadsherif.com>2016-10-11 14:25:17 +0200
committerAhmad Sherif <me@ahmadsherif.com>2016-11-18 20:25:45 +0200
commitfd05e26618dd0c123ca476b6f5a3d85f1cfe397a (patch)
tree39a4ac60382ca7ce8d46e3745ba8a381580d6314 /spec/models/project_spec.rb
parentaea8baed3093c513560e9ac5ac0c5c99508d3001 (diff)
downloadgitlab-ce-fd05e26618dd0c123ca476b6f5a3d85f1cfe397a.tar.gz
Precalculate user's authorized projects in database
Closes #23150
Diffstat (limited to 'spec/models/project_spec.rb')
-rw-r--r--spec/models/project_spec.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb
index 46fa00a79c4..e637c464b18 100644
--- a/spec/models/project_spec.rb
+++ b/spec/models/project_spec.rb
@@ -1514,7 +1514,7 @@ describe Project, models: true do
members_project.team << [developer, :developer]
members_project.team << [master, :master]
- create(:project_group_link, project: shared_project, group: group)
+ create(:project_group_link, project: shared_project, group: group, group_access: Gitlab::Access::DEVELOPER)
end
it 'returns false for no user' do
@@ -1543,7 +1543,9 @@ describe Project, models: true do
expect(members_project.authorized_for_user?(developer, Gitlab::Access::MASTER)).to be(false)
expect(members_project.authorized_for_user?(master, Gitlab::Access::MASTER)).to be(true)
expect(shared_project.authorized_for_user?(developer, Gitlab::Access::MASTER)).to be(false)
- expect(shared_project.authorized_for_user?(master, Gitlab::Access::MASTER)).to be(true)
+ expect(shared_project.authorized_for_user?(master, Gitlab::Access::MASTER)).to be(false)
+ expect(shared_project.authorized_for_user?(developer, Gitlab::Access::DEVELOPER)).to be(true)
+ expect(shared_project.authorized_for_user?(master, Gitlab::Access::DEVELOPER)).to be(true)
end
end