Mercurial > hg > soundsoftware-site
comparison test/functional/sys_controller_test.rb @ 441:cbce1fd3b1b7 redmine-1.2
Update to Redmine 1.2-stable branch (Redmine SVN rev 6000)
author | Chris Cannam |
---|---|
date | Mon, 06 Jun 2011 14:24:13 +0100 |
parents | 8661b858af72 |
children | cbb26bc654de |
comparison
equal
deleted
inserted
replaced
245:051f544170fe | 441:cbce1fd3b1b7 |
---|---|
1 # Redmine - project management software | 1 # Redmine - project management software |
2 # Copyright (C) 2006-2009 Jean-Philippe Lang | 2 # Copyright (C) 2006-2011 Jean-Philippe Lang |
3 # | 3 # |
4 # This program is free software; you can redistribute it and/or | 4 # This program is free software; you can redistribute it and/or |
5 # modify it under the terms of the GNU General Public License | 5 # modify it under the terms of the GNU General Public License |
6 # as published by the Free Software Foundation; either version 2 | 6 # as published by the Free Software Foundation; either version 2 |
7 # of the License, or (at your option) any later version. | 7 # of the License, or (at your option) any later version. |
15 # along with this program; if not, write to the Free Software | 15 # along with this program; if not, write to the Free Software |
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
17 | 17 |
18 require File.expand_path('../../test_helper', __FILE__) | 18 require File.expand_path('../../test_helper', __FILE__) |
19 require 'sys_controller' | 19 require 'sys_controller' |
20 require 'mocha' | |
20 | 21 |
21 # Re-raise errors caught by the controller. | 22 # Re-raise errors caught by the controller. |
22 class SysController; def rescue_action(e) raise e end; end | 23 class SysController; def rescue_action(e) raise e end; end |
23 | 24 |
24 class SysControllerTest < ActionController::TestCase | 25 class SysControllerTest < ActionController::TestCase |
25 fixtures :projects, :repositories | 26 fixtures :projects, :repositories, :enabled_modules |
26 | 27 |
27 def setup | 28 def setup |
28 @controller = SysController.new | 29 @controller = SysController.new |
29 @request = ActionController::TestRequest.new | 30 @request = ActionController::TestRequest.new |
30 @response = ActionController::TestResponse.new | 31 @response = ActionController::TestResponse.new |
53 assert r.is_a?(Repository::Subversion) | 54 assert r.is_a?(Repository::Subversion) |
54 assert_equal 'file:///create/project/repository/subproject2', r.url | 55 assert_equal 'file:///create/project/repository/subproject2', r.url |
55 end | 56 end |
56 | 57 |
57 def test_fetch_changesets | 58 def test_fetch_changesets |
59 Repository::Subversion.any_instance.expects(:fetch_changesets).returns(true) | |
58 get :fetch_changesets | 60 get :fetch_changesets |
59 assert_response :success | 61 assert_response :success |
60 end | 62 end |
61 | 63 |
62 def test_fetch_changesets_one_project | 64 def test_fetch_changesets_one_project |
65 Repository::Subversion.any_instance.expects(:fetch_changesets).returns(true) | |
63 get :fetch_changesets, :id => 'ecookbook' | 66 get :fetch_changesets, :id => 'ecookbook' |
64 assert_response :success | 67 assert_response :success |
65 end | 68 end |
66 | 69 |
67 def test_fetch_changesets_unknown_project | 70 def test_fetch_changesets_unknown_project |