Update project activity when pushing to a wiki repository
This commit is contained in:
parent
8033da7ae7
commit
c0c3170381
2 changed files with 13 additions and 1 deletions
|
@ -55,7 +55,7 @@ class PostReceive
|
||||||
end
|
end
|
||||||
|
|
||||||
def process_wiki_changes(post_received)
|
def process_wiki_changes(post_received)
|
||||||
# Nothing defined here yet.
|
post_received.project.touch(:last_activity_at, :last_repository_updated_at)
|
||||||
end
|
end
|
||||||
|
|
||||||
def log(message)
|
def log(message)
|
||||||
|
|
|
@ -114,6 +114,18 @@ describe PostReceive do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe '#process_wiki_changes' do
|
||||||
|
let(:gl_repository) { "wiki-#{project.id}" }
|
||||||
|
|
||||||
|
it 'updates project activity' do
|
||||||
|
described_class.new.perform(gl_repository, key_id, base64_changes)
|
||||||
|
|
||||||
|
expect { project.reload }
|
||||||
|
.to change(project, :last_activity_at)
|
||||||
|
.and change(project, :last_repository_updated_at)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
context "webhook" do
|
context "webhook" do
|
||||||
it "fetches the correct project" do
|
it "fetches the correct project" do
|
||||||
expect(Project).to receive(:find_by).with(id: project.id.to_s)
|
expect(Project).to receive(:find_by).with(id: project.id.to_s)
|
||||||
|
|
Loading…
Reference in a new issue