incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [4/4] git commit: [#5691] ticket:263 Test for incorect ticket references in notifications
Date Thu, 31 Jan 2013 21:59:12 GMT
Updated Branches:
  refs/heads/master be42517ff -> 0fb0b2ada


[#5691] ticket:263 Test for incorect ticket references in notifications


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/0fb0b2ad
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/0fb0b2ad
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/0fb0b2ad

Branch: refs/heads/master
Commit: 0fb0b2ada4a06ade86129cd96989091e7e55d762
Parents: 7cf996a
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Thu Jan 31 13:09:01 2013 +0000
Committer: Dave Brondsema <dbrondsema@geek.net>
Committed: Thu Jan 31 21:58:48 2013 +0000

----------------------------------------------------------------------
 .../forgetracker/tests/functional/test_root.py     |   32 +++++++++++++++
 1 files changed, 32 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0fb0b2ad/ForgeTracker/forgetracker/tests/functional/test_root.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tests/functional/test_root.py b/ForgeTracker/forgetracker/tests/functional/test_root.py
index af8d28a..58c1c7e 100644
--- a/ForgeTracker/forgetracker/tests/functional/test_root.py
+++ b/ForgeTracker/forgetracker/tests/functional/test_root.py
@@ -1245,6 +1245,38 @@ class TestFunctionalController(TrackerTestController):
         self.app.get('/p/test/bugs/2/', status=200)  # shouldn't fail
         self.app.get('/p/test/bugs/1/', status=404)  # shouldn't fail
 
+    @td.with_tool('test', 'Tickets', 'dummy')
+    def test_move_ticket_email_notifications(self):
+        """See [#5691] for details"""
+        # create two tickets and ensure they are viewable
+        self.new_ticket(summary='test 1')
+        self.new_ticket(summary='test 2')
+        self.app.get('/p/test/bugs/1/', status=200)  # shouldn't fail
+        self.app.get('/p/test/bugs/2/', status=200)  # shouldn't fail
+
+        # move ticket 1 to 'dummy' tracker
+        p = M.Project.query.get(shortname='test')
+        dummy_tracker = p.app_instance('dummy')
+        r = self.app.post('/p/test/bugs/1/move',
+                params={'tracker': str(dummy_tracker.config._id)}).follow()
+        assert_equal(r.request.path, '/p/test/dummy/1/')
+
+        # comment ticket 2
+        M.Notification.query.remove()
+        r = self.app.get('/p/test/bugs/2/')
+        field_name = None  # comment text textarea name
+        for name, field in r.forms[2].fields.iteritems():
+            if field[0].tag == 'textarea':
+                field_name = name
+        assert field_name, "Can't find comment field"
+        r.forms[2].fields[field_name][0].value = 'Hi there'
+        r.forms[2].submit()
+
+        # notification for ticket 2 should reference [test:bugs], not [test:dummy]
+        n = M.Notification.query.find().all()[0]
+        assert_in('[test:bugs]', n.subject)
+        assert_in('[test:bugs]', n.reply_to_address)
+
 
 class TestMilestoneAdmin(TrackerTestController):
     def _post(self, params, **kw):


Mime
View raw message