Update last_repository_updated_at when the wiki is updated

parent 91b5aaf7
......@@ -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
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment