You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by tv...@apache.org on 2014/03/18 18:24:15 UTC

[5/6] git commit: [#7051] Add test for sitemap depth limiting

[#7051] Add test for sitemap depth limiting

Signed-off-by: Tim Van Steenburgh <tv...@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/tv/7051
Commit: 186c3a3e1994c549758e2fb9a8dcc6d0ca6cd85b
Parents: 1d66eb3
Author: Tim Van Steenburgh <tv...@gmail.com>
Authored: Tue Mar 18 16:29:05 2014 +0000
Committer: Tim Van Steenburgh <tv...@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):