allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jetm...@apache.org
Subject [1/2] allura git commit: [#7946] ticket:846 Add test for chat's configure
Date Tue, 22 Sep 2015 14:07:34 GMT
Repository: allura
Updated Branches:
  refs/heads/ib/7946 [created] 58634ef32


[#7946] ticket:846 Add test for chat's configure

It actually passes, cause turns out problem is in js, but can be still
useful in the future.


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

Branch: refs/heads/ib/7946
Commit: 70684237554902539e8cfb61c967dcf754947498
Parents: 1d6f87b
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Tue Sep 22 16:21:16 2015 +0300
Committer: Igor Bondarenko <jetmind2@gmail.com>
Committed: Tue Sep 22 16:21:16 2015 +0300

----------------------------------------------------------------------
 .../forgechat/tests/functional/test_root.py     | 22 ++++++++++++++++++++
 1 file changed, 22 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/70684237/ForgeChat/forgechat/tests/functional/test_root.py
----------------------------------------------------------------------
diff --git a/ForgeChat/forgechat/tests/functional/test_root.py b/ForgeChat/forgechat/tests/functional/test_root.py
index 013176c..49b824d 100644
--- a/ForgeChat/forgechat/tests/functional/test_root.py
+++ b/ForgeChat/forgechat/tests/functional/test_root.py
@@ -15,7 +15,16 @@
 #       specific language governing permissions and limitations
 #       under the License.
 
+import json
+from datadiff.tools import assert_equal
+
 from alluratest.controller import TestController
+from allura.tests.decorators import with_tool
+
+from forgechat import model as CM
+
+
+with_chat = with_tool('test', 'Chat', 'chat', 'Chat')
 
 
 class TestRootController(TestController):
@@ -23,3 +32,16 @@ class TestRootController(TestController):
     def test_root_index(self):
         response = self.app.get('/chat/').follow()
         assert 'Log for' in response
+
+    @with_chat
+    def test_admin_configure(self):
+        self.app.get('/')  # establish session
+        data = {'channel': 'test channel',
+                '_session_id': self.app.cookies['_session_id']}
+        ch = CM.ChatChannel.query.get()
+        assert_equal(ch.channel, '')
+        resp = self.app.post('/p/test/admin/chat/configure', data)
+        expected = {'status': 'ok', 'message': 'Chat options updated'}
+        assert_equal(json.loads(self.webflash(resp)), expected)
+        ch = CM.ChatChannel.query.get()
+        assert_equal(ch.channel, 'test channel')


Mime
View raw message