mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	integrations: Reformat Github issue assigned message body.
Instead of adding the assignee to the end of the message body, we update the message body where the verb is so that the link formatting at the end of the message is not broken, for example: "user_a assigned user_b to [issue #XXX title text is here](link)." Also updates the issue title in the test fixture so that it tests that only the first instance of "assigned" or "unassigned" in the issue title is updated for the assignee text. Also adds punctuation to the issue title in the test fixture to test the expected behavior for titles that end in a value from `string.punctuation`.
This commit is contained in:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							d82efbd503
						
					
				
				
					commit
					f6e17fa972
				
			@@ -160,14 +160,14 @@ class GitHubWebhookTest(WebhookTestCase):
 | 
			
		||||
        self.check_webhook("issues", expected_topic, expected_message)
 | 
			
		||||
 | 
			
		||||
    def test_issue_assigned(self) -> None:
 | 
			
		||||
        expected_message = "sbansal1999 assigned [issue #7](https://github.com/sbansal1999/testing-gh/issues/7) to sbansal1999."
 | 
			
		||||
        expected_topic = "testing-gh / issue #7 Sample Issue testing something"
 | 
			
		||||
        expected_message = "sbansal1999 assigned sbansal1999 to [issue #7](https://github.com/sbansal1999/testing-gh/issues/7)."
 | 
			
		||||
        expected_topic = "testing-gh / issue #7 Testing when issue assigned!"
 | 
			
		||||
        self.check_webhook("issues__assigned", expected_topic, expected_message)
 | 
			
		||||
 | 
			
		||||
    def test_issue_assigned_with_custom_topic_in_url(self) -> None:
 | 
			
		||||
        self.url = self.build_webhook_url(topic="notifications")
 | 
			
		||||
        expected_topic = "notifications"
 | 
			
		||||
        expected_message = "sbansal1999 assigned [issue #7 Sample Issue testing something](https://github.com/sbansal1999/testing-gh/issues/7) to sbansal1999."
 | 
			
		||||
        expected_message = "sbansal1999 assigned sbansal1999 to [issue #7 Testing when issue assigned!](https://github.com/sbansal1999/testing-gh/issues/7)"
 | 
			
		||||
        self.check_webhook("issues__assigned", expected_topic, expected_message)
 | 
			
		||||
 | 
			
		||||
    def test_issue_unassigned(self) -> None:
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user