Commit 9b97be8c authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre Committed by Robert Speicher

Update last_repository_updated_at when the wiki is updated

parent 2d2f13f1
......@@ -196,7 +196,7 @@ class ProjectWiki
end
def update_project_activity
@project.touch(:last_activity_at)
@project.touch(:last_activity_at, :last_repository_updated_at)
end
def update_elastic_index
......
......@@ -221,9 +221,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
......@@ -248,9 +251,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
......@@ -266,9 +272,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