allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [40/50] [abbrv] allura git commit: [#7919] tests for _nav.json?admin_options=1
Date Fri, 08 Jan 2016 19:30:45 GMT
[#7919] tests for _nav.json?admin_options=1


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

Branch: refs/heads/master
Commit: 2a78e693c4838d909a9ffe603bef64facf6bdddf
Parents: 873bb09
Author: Dave Brondsema <dave@brondsema.net>
Authored: Thu Dec 17 14:57:01 2015 -0500
Committer: Dave Brondsema <dave@brondsema.net>
Committed: Fri Jan 8 14:06:18 2016 -0500

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


http://git-wip-us.apache.org/repos/asf/allura/blob/2a78e693/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 302d19c..c4da5bc 100644
--- a/Allura/allura/tests/functional/test_home.py
+++ b/Allura/allura/tests/functional/test_home.py
@@ -42,6 +42,43 @@ class TestProjectHome(TestController):
             assert nl['href'] == entry['url']
 
     @td.with_wiki
+    def test_project_nav_with_admin_options(self):
+        r = self.app.get('/p/test/_nav.json?admin_options=1')
+        assert_in({
+            "text": "Wiki",
+            "href": "/p/test/admin/install_tool?tool_name=wiki",
+            "tooltip":
+                "Documentation is key to your project and the wiki tool helps make it easy
for anyone to contribute."
+        }, r.json['installable_tools'])
+        for m in r.json['menu']:
+            if m['mount_point'] == 'sub1':
+                assert_equal(m['admin_options'],
+                             [{'className': None,
+                               'text': 'Subproject Admin',
+                               'href': '/p/test/sub1/admin',
+                               }])
+                break
+        else:
+            raise AssertionError(u'Did not find sub1 subproject in menu results: {}'.format(r.json['menu']))
+        for m in r.json['menu']:
+            if m['mount_point'] == 'wiki':
+                assert_in({'className': 'admin_modal',
+                           'text': 'Set Home',
+                           'href': '/p/test/admin/wiki/home',
+                           }, m['admin_options'])
+                assert_in({'className': None,
+                           'text': 'Permissions',
+                           'href': '/p/test/admin/wiki/permissions',
+                           }, m['admin_options'])
+                assert_in({'className': 'admin_modal',
+                           'text': 'Delete',
+                           'href': '/p/test/admin/wiki/delete',
+                           }, m['admin_options'])
+                break
+        else:
+            raise AssertionError(u'Did not find wiki in menu results: {}'.format(r.json['menu']))
+
+    @td.with_wiki
     def test_project_group_nav(self):
         c.user = M.User.by_username('test-admin')
         p = M.Project.query.get(shortname='test')


Mime
View raw message