Skip to content
Snippets Groups Projects
Commit 9f2edaa8 authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre
Browse files

Update last_repository_updated_at when the wiki is updated

parent 91b5aaf7
No related branches found
No related tags found
1 merge request!11085Port of "2274-store-last-repository-updated-at" to CE
Loading
Loading
@@ -183,6 +183,6 @@ class ProjectWiki
end
 
def update_project_activity
@project.touch(:last_activity_at)
@project.touch(:last_activity_at, :last_repository_updated_at)
end
end
Loading
Loading
@@ -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
 
Loading
Loading
@@ -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
 
Loading
Loading
@@ -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
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment