mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +00:00
webhooks_gitea: Add tests and fixture for correct actor on PR close.
Previously, closing a pull request by someone other than its creator could result in Zulip notifications attributing the action to the wrong user. This change adds a focused test and a fixture capturing the case where the webhook sender differs from pull_request.user, ensuring the correct actor is mentioned for pull_request close events. Follow-up to #36184.
This commit is contained in:
@@ -51,6 +51,11 @@ class GiteaHookTests(WebhookTestCase):
|
||||
expected_message = """kostekIV closed [PR #5](https://try.gitea.io/kostekIV/test/pulls/5) from `d` to `master`."""
|
||||
self.check_webhook("pull_request__closed", expected_topic_name, expected_message)
|
||||
|
||||
def test_pull_request_closed_different_user(self) -> None:
|
||||
expected_topic_name = "test / PR #126085 PR closed"
|
||||
expected_message = """Aneesh-Hegde closed [PR #1](https://gitea.com/Aneesh-Hegde/test-repo/pulls/1) from `main` to `main`."""
|
||||
self.check_webhook("pull_request__closed_diff_user", expected_topic_name, expected_message)
|
||||
|
||||
def test_pull_request_assigned(self) -> None:
|
||||
expected_topic_name = "test / PR #1906 test 2"
|
||||
expected_message = """kostekIV assigned kostekIV to [PR #5](https://try.gitea.io/kostekIV/test/pulls/5) from `d` to `master` (assigned to kostekIV)."""
|
||||
|
Reference in New Issue
Block a user