summaryrefslogtreecommitdiffstats
path: root/test/functional
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-12-10 17:58:07 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-12-10 17:58:07 +0000
commit6d9490ddcc9c501d31a8b403146cd4ba6d8cc5b5 (patch)
treead4a6a8cbc3ec2dadf61886a67c19ffc66ec6710 /test/functional
parentf58db70bdecdbfd0a0d81c0c452d58b88391f9f1 (diff)
downloadredmine-6d9490ddcc9c501d31a8b403146cd4ba6d8cc5b5.tar.gz
redmine-6d9490ddcc9c501d31a8b403146cd4ba6d8cc5b5.zip
Merged Rails 2.0 compatibility changes.
Compatibility with Rails 1.2 is preserved. git-svn-id: http://redmine.rubyforge.org/svn/trunk@975 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/sys_api_test.rb31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/functional/sys_api_test.rb b/test/functional/sys_api_test.rb
new file mode 100644
index 000000000..ec8d0964e
--- /dev/null
+++ b/test/functional/sys_api_test.rb
@@ -0,0 +1,31 @@
+require File.dirname(__FILE__) + '/../test_helper'
+require 'sys_controller'
+
+# Re-raise errors caught by the controller.
+class SysController; def rescue_action(e) raise e end; end
+
+class SysControllerTest < Test::Unit::TestCase
+ fixtures :projects, :repositories
+
+ def setup
+ @controller = SysController.new
+ @request = ActionController::TestRequest.new
+ @response = ActionController::TestResponse.new
+ # Enable WS
+ Setting.sys_api_enabled = 1
+ end
+
+ def test_projects
+ result = invoke :projects
+ assert_equal Project.count, result.size
+ assert result.first.is_a?(Project)
+ end
+
+ def test_repository_created
+ project = Project.find(3)
+ assert_nil project.repository
+ assert invoke(:repository_created, project.identifier, 'http://localhost/svn')
+ project.reload
+ assert_not_nil project.repository
+ end
+end