diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2017-05-03 22:47:10 -0300 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2017-05-04 15:44:11 -0300 |
commit | 9f2edaa84642113d33fee37eee1a8daca2be54c0 (patch) | |
tree | 0927b5dfc5788845d4528ca95c0de603f2239006 /spec/models | |
parent | 91b5aaf770836b7101414527a4650db5fa669ce2 (diff) | |
download | gitlab-ce-9f2edaa84642113d33fee37eee1a8daca2be54c0.tar.gz |
Update last_repository_updated_at when the wiki is updated
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/project_wiki_spec.rb | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/spec/models/project_wiki_spec.rb b/spec/models/project_wiki_spec.rb index b5b9cd024b0..969e9f7a130 100644 --- a/spec/models/project_wiki_spec.rb +++ b/spec/models/project_wiki_spec.rb @@ -213,9 +213,12 @@ describe ProjectWiki, models: true do end it 'updates project activity' do - expect(subject).to receive(:update_project_activity) - subject.create_page('Test Page', 'This is content') + + project.reload + + expect(project.last_activity_at).to be_within(1.minute).of(Time.now) + expect(project.last_repository_updated_at).to be_within(1.minute).of(Time.now) end end @@ -240,9 +243,12 @@ describe ProjectWiki, models: true do end it 'updates project activity' do - expect(subject).to receive(:update_project_activity) - subject.update_page(@gollum_page, 'Yet more content', :markdown, 'Updated page again') + + project.reload + + expect(project.last_activity_at).to be_within(1.minute).of(Time.now) + expect(project.last_repository_updated_at).to be_within(1.minute).of(Time.now) end end @@ -258,9 +264,12 @@ describe ProjectWiki, models: true do end it 'updates project activity' do - expect(subject).to receive(:update_project_activity) - subject.delete_page(@page) + + project.reload + + expect(project.last_activity_at).to be_within(1.minute).of(Time.now) + expect(project.last_repository_updated_at).to be_within(1.minute).of(Time.now) end end |