Update last_repository_updated_at when the wiki is updated

parent 91b5aaf7
...@@ -183,6 +183,6 @@ class ProjectWiki ...@@ -183,6 +183,6 @@ class ProjectWiki
end end
def update_project_activity def update_project_activity
@project.touch(:last_activity_at) @project.touch(:last_activity_at, :last_repository_updated_at)
end end
end end
...@@ -213,9 +213,12 @@ describe ProjectWiki, models: true do ...@@ -213,9 +213,12 @@ describe ProjectWiki, models: true do
end end
it 'updates project activity' do it 'updates project activity' do
expect(subject).to receive(:update_project_activity)
subject.create_page('Test Page', 'This is content') 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
end end
...@@ -240,9 +243,12 @@ describe ProjectWiki, models: true do ...@@ -240,9 +243,12 @@ describe ProjectWiki, models: true do
end end
it 'updates project activity' do it 'updates project activity' do
expect(subject).to receive(:update_project_activity)
subject.update_page(@gollum_page, 'Yet more content', :markdown, 'Updated page again') 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
end end
...@@ -258,9 +264,12 @@ describe ProjectWiki, models: true do ...@@ -258,9 +264,12 @@ describe ProjectWiki, models: true do
end end
it 'updates project activity' do it 'updates project activity' do
expect(subject).to receive(:update_project_activity)
subject.delete_page(@page) 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
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