Use "synchronized" (past tense) in github webhook.

Normally github gives us a past tense version of the action, but
not for "synchronize," so we fix up the tense.

This also adds zerver.GithubHookTests.test_pull_request_synchronize

(imported from commit ef69467ed4a02dbfa94c8215fb9043b668d1dec9)
This commit is contained in:
Steve Howell
2014-01-21 12:06:40 -05:00
parent 8f9d29189c
commit 6c6d1ee474
2 changed files with 10 additions and 1 deletions

View File

@@ -25,10 +25,14 @@ def github_generic_subject(noun, topic_focus, blob):
return "%s: %s %d: %s" % (topic_focus, noun, blob['number'], blob['title'])
def github_generic_content(noun, payload, blob):
action = payload['action']
if action == 'synchronize':
action = 'synchronized'
# issue and pull_request objects have the same fields we're interested in
content = ("%s %s [%s %s](%s)"
% (payload['sender']['login'],
payload['action'],
action,
noun,
blob['number'],
blob['html_url']))