incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [1/2] git commit: [#5177] Added test for default source and target_branch values for merge requests
Date Tue, 13 Aug 2013 21:28:42 GMT
Updated Branches:
  refs/heads/master 9a13632b5 -> dfafc6251


[#5177] Added test for default source and target_branch values for merge requests

Signed-off-by: Cory Johns <cjohns@slashdotmedia.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/dfafc625
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/dfafc625
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/dfafc625

Branch: refs/heads/master
Commit: dfafc62517a4ed101fa38f1e93c2b11e8d2146ef
Parents: 45732c0
Author: Cory Johns <cjohns@slashdotmedia.com>
Authored: Tue Aug 13 19:18:32 2013 +0000
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Tue Aug 13 21:28:33 2013 +0000

----------------------------------------------------------------------
 .../forgegit/tests/functional/test_controllers.py | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/dfafc625/ForgeGit/forgegit/tests/functional/test_controllers.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/functional/test_controllers.py b/ForgeGit/forgegit/tests/functional/test_controllers.py
index d8c3f2c..597c5bb 100644
--- a/ForgeGit/forgegit/tests/functional/test_controllers.py
+++ b/ForgeGit/forgegit/tests/functional/test_controllers.py
@@ -33,6 +33,7 @@ from allura.lib import helpers as h
 from alluratest.controller import TestController
 from allura.tests.decorators import with_tool
 from forgegit.tests import with_git
+from forgegit import model as GM
 
 class _TestCase(TestController):
 
@@ -517,6 +518,23 @@ class TestFork(_TestCase):
                           params=dict(status='rejected')).follow()
         assert 'Merge Request #%s:  (rejected)' % mr_num in r, r
 
+    def test_merge_request_default_branches(self):
+        _select_val = lambda r, n: r.html.find('select', {'name': n}).find(selected=True).string
+        r = self.app.get('/p/test2/code/request_merge')
+        assert_equal(_select_val(r, 'source_branch'), 'master')
+        assert_equal(_select_val(r, 'target_branch'), 'master')
+        r = self.app.get('/p/test2/code/ci/zz/tree/').click('Request Merge')
+        assert_equal(_select_val(r, 'source_branch'), 'zz')
+        assert_equal(_select_val(r, 'target_branch'), 'master')
+        GM.Repository.query.get(_id=c.app.repo._id).default_branch_name = 'zz'
+        ThreadLocalORMSession.flush_all()
+        r = self.app.get('/p/test2/code/request_merge')
+        assert_equal(_select_val(r, 'source_branch'), 'master')
+        assert_equal(_select_val(r, 'target_branch'), 'zz')
+        r = self.app.get('/p/test2/code/ci/zz/tree/').click('Request Merge')
+        assert_equal(_select_val(r, 'source_branch'), 'zz')
+        assert_equal(_select_val(r, 'target_branch'), 'zz')
+
 class TestDiff(TestController):
 
     def setUp(self):


Mime
View raw message