Add some message editing tests for invalid input.

This commit is contained in:
Tim Abbott 2016-07-10 17:55:57 -07:00
parent 211a166abc
commit 0d418d5695
1 changed files with 19 additions and 0 deletions

View File

@ -750,6 +750,25 @@ class EditMessageTest(AuthedTestCase):
self.assert_json_success(result)
self.check_message(msg_id, subject="edited")
def test_edit_message_no_changes(self):
self.login("hamlet@zulip.com")
msg_id = self.send_message("hamlet@zulip.com", "Scotland", Recipient.STREAM,
subject="editing", content="before edit")
result = self.client.post("/json/update_message", {
'message_id': msg_id,
})
self.assert_json_error(result, "Nothing to change")
def test_edit_message_no_topic(self):
self.login("hamlet@zulip.com")
msg_id = self.send_message("hamlet@zulip.com", "Scotland", Recipient.STREAM,
subject="editing", content="before edit")
result = self.client.post("/json/update_message", {
'message_id': msg_id,
'subject': ' '
})
self.assert_json_error(result, "Topic can't be empty")
def test_propagate_topic_forward(self):
self.login("hamlet@zulip.com")
id1 = self.send_message("hamlet@zulip.com", "Scotland", Recipient.STREAM,