incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [2/3] git commit: [#5465] ticket:310 Test for label autocompletion data provider
Date Wed, 10 Apr 2013 22:27:31 GMT
[#5465] ticket:310 Test for label autocompletion data provider


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

Branch: refs/heads/master
Commit: 828b29fc85aff2757cd088c333bcbfff24950603
Parents: b970ea6
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Wed Apr 10 14:24:25 2013 +0000
Committer: Cory Johns <cjohns@slashdotmedia.com>
Committed: Wed Apr 10 22:00:17 2013 +0000

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


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/828b29fc/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 b2fd554..917b064 100644
--- a/ForgeTracker/forgetracker/tests/functional/test_root.py
+++ b/ForgeTracker/forgetracker/tests/functional/test_root.py
@@ -1435,6 +1435,23 @@ class TestFunctionalController(TrackerTestController):
         assert_equal(r.request.path, '/p/test/dummy/1/')
         assert_in('I am comment', r)
 
+    def test_tags(self):
+        p = M.Project.query.get(shortname='test')
+        tracker = p.app_instance('bugs')
+        self.new_ticket(summary='a', labels='tag1,tag2')
+        self.new_ticket(summary='b', labels='tag2')
+        self.new_ticket(summary='c', labels='42cc,test')
+        r = self.app.get('/p/test/bugs/tags?term=t')
+        assert_equal(json.loads(r.body), ['tag2', 'tag1', 'test'])
+        r = self.app.get('/p/test/bugs/tags?term=ta')
+        assert_equal(json.loads(r.body), ['tag2', 'tag1'])
+        r = self.app.get('/p/test/bugs/tags?term=te')
+        assert_equal(json.loads(r.body), ['test'])
+        r = self.app.get('/p/test/bugs/tags?term=nope')
+        assert_equal(json.loads(r.body), [])
+        r = self.app.get('/p/test/bugs/tags?term=')
+        assert_equal(json.loads(r.body), [])
+
 
 class TestMilestoneAdmin(TrackerTestController):
     def _post(self, params, **kw):


Mime
View raw message