mirror of
https://github.com/redmine/redmine.git
synced 2026-05-06 08:56:24 +02:00
User groups branch added.
git-svn-id: http://redmine.rubyforge.org/svn/branches/work@1372 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
31
groups/test/functional/sys_api_test.rb
Normal file
31
groups/test/functional/sys_api_test.rb
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user