incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [04/17] git commit: [#7051] Add test for sitemap depth limiting
Date Thu, 20 Mar 2014 18:46:37 GMT
[#7051] Add test for sitemap depth limiting

Signed-off-by: Tim Van Steenburgh <tvansteenburgh@gmail.com>


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

Branch: refs/heads/cj/6701
Commit: 186c3a3e1994c549758e2fb9a8dcc6d0ca6cd85b
Parents: 1d66eb3
Author: Tim Van Steenburgh <tvansteenburgh@gmail.com>
Authored: Tue Mar 18 16:29:05 2014 +0000
Committer: Tim Van Steenburgh <tvansteenburgh@gmail.com>
Committed: Tue Mar 18 16:31:08 2014 +0000

----------------------------------------------------------------------
 Allura/allura/tests/functional/test_home.py | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/186c3a3e/Allura/allura/tests/functional/test_home.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/functional/test_home.py b/Allura/allura/tests/functional/test_home.py
index 54c34b7..3b790aa 100644
--- a/Allura/allura/tests/functional/test_home.py
+++ b/Allura/allura/tests/functional/test_home.py
@@ -58,6 +58,20 @@ class TestProjectHome(TestController):
         assert {u'url': u'/p/test/wiki2/', u'name': u'wiki2', u'icon':
                 u'tool-wiki', 'tool_name': 'wiki'} in wikis, wikis
 
+    def test_sitemap_limit_per_tool(self):
+        """Test that sitemap is limited to max of 10 items per tool type."""
+        c.user = M.User.by_username('test-admin')
+        p = M.Project.query.get(shortname='test')
+        c.project = p
+        for i in range(11):
+            mnt = 'wiki' + str(i)
+            p.install_app('wiki', mnt, mnt, 10 + i)
+
+        response = self.app.get('/p/test/_nav.json')
+        menu = response.json['menu']
+        wikis = menu[-2]['children']
+        assert_equal(len(wikis), 10)
+
     @td.with_wiki
     def test_project_group_nav_more_than_ten(self):
         for i in range(1, 15):


Mime
View raw message