summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorAndreas Brandl <abrandl@gitlab.com>2018-02-23 20:56:43 +0100
committerAndreas Brandl <abrandl@gitlab.com>2018-03-06 12:53:13 +0100
commitd4d0740e24315e7071f90b3744377b3ca3b5816a (patch)
treef8f2e6cc95617808db683c6e26aad9e251140547 /spec
parentebcf3c73bd515a4884961999ef7d33edaba93d57 (diff)
downloadgitlab-ce-d4d0740e24315e7071f90b3744377b3ca3b5816a.tar.gz
Cache project/user combinations.
Diffstat (limited to 'spec')
-rw-r--r--spec/models/user_contributed_projects_spec.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/spec/models/user_contributed_projects_spec.rb b/spec/models/user_contributed_projects_spec.rb
index 5b8c61750b3..b0a10ca59ab 100644
--- a/spec/models/user_contributed_projects_spec.rb
+++ b/spec/models/user_contributed_projects_spec.rb
@@ -12,16 +12,17 @@ describe UserContributedProjects do
it 'creates a record' do
expect { subject }.to change { UserContributedProjects.count }.from(0).to(1)
end
-
end
end
it 'sets project accordingly' do
- expect(subject.project).to eq(event.project)
+ subject
+ expect(UserContributedProjects.first.project).to eq(event.project)
end
it 'sets user accordingly' do
- expect(subject.user).to eq(event.author)
+ subject
+ expect(UserContributedProjects.first.user).to eq(event.author)
end
it 'only creates a record once per user/project' do