diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2016-10-07 11:13:26 +0000 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2016-10-07 11:13:26 +0000 |
commit | 8581df3bfb9e847d07a585a22cfa21658ae40ea2 (patch) | |
tree | 292f349c5bb1bbaee67e10f357067287e3ab06e5 /spec | |
parent | 0876b46024be019d9ef9846045d3941dcdf90981 (diff) | |
parent | 1662640985b56390a4d22dab1fee7fd04ccd5bc8 (diff) | |
download | gitlab-ce-8581df3bfb9e847d07a585a22cfa21658ae40ea2.tar.gz |
Merge branch 'sh-fix-events-update-spec' into 'master'
Fix Event#reset_project_activity updates
See merge request !6729
Diffstat (limited to 'spec')
-rw-r--r-- | spec/models/project_spec.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index 381d14ed21a..8aadfcb439b 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -308,7 +308,9 @@ describe Project, models: true do end describe 'last_activity methods' do - let(:project) { create(:project, last_activity_at: 2.hours.ago) } + let(:timestamp) { 2.hours.ago } + # last_activity_at gets set to created_at upon creation + let(:project) { create(:project, created_at: timestamp, updated_at: timestamp) } describe 'last_activity' do it 'alias last_activity to last_event' do @@ -322,6 +324,7 @@ describe Project, models: true do it 'returns the creation date of the project\'s last event if present' do new_event = create(:event, project: project, created_at: Time.now) + project.reload expect(project.last_activity_at.to_i).to eq(new_event.created_at.to_i) end |