diff options
author | Andreas Brandl <abrandl@gitlab.com> | 2018-02-23 20:56:43 +0100 |
---|---|---|
committer | Andreas Brandl <abrandl@gitlab.com> | 2018-03-06 12:53:13 +0100 |
commit | d4d0740e24315e7071f90b3744377b3ca3b5816a (patch) | |
tree | f8f2e6cc95617808db683c6e26aad9e251140547 /spec | |
parent | ebcf3c73bd515a4884961999ef7d33edaba93d57 (diff) | |
download | gitlab-ce-d4d0740e24315e7071f90b3744377b3ca3b5816a.tar.gz |
Cache project/user combinations.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/models/user_contributed_projects_spec.rb | 7 |
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 |