1
0
mirror of https://github.com/meineerde/redmine.git synced 2026-03-11 03:33:07 +00:00

Fixes functional tests.

git-svn-id: http://redmine.rubyforge.org/svn/branches/nbc@1804 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2008-09-13 10:04:39 +00:00
parent 8e48c9ff9d
commit c77d9712ca
2 changed files with 23 additions and 6 deletions

View File

@ -24,7 +24,7 @@ class SysController < ActionController::Base
# Returns the projects list, with their repositories
def projects_with_repository_enabled
Project.repository_enabled(:all, :include => :repository)
Project.repository_enabled(:all, :include => :repository, :order => 'identifier')
end
# Registers a repository for the given project identifier

View File

@ -5,7 +5,7 @@ require 'sys_controller'
class SysController; def rescue_action(e) raise e end; end
class SysControllerTest < Test::Unit::TestCase
fixtures :projects, :repositories
fixtures :projects, :enabled_modules, :repositories
def setup
@controller = SysController.new
@ -15,10 +15,27 @@ class SysControllerTest < Test::Unit::TestCase
Setting.sys_api_enabled = 1
end
def test_projects
result = invoke :projects
assert_equal Project.count, result.size
assert result.first.is_a?(Project)
def test_projects_with_repository_enabled
result = invoke :projects_with_repository_enabled
assert_equal EnabledModule.count(:all, :conditions => {:name => 'repository'}), result.size
project = result.first
assert project.is_a?(AWSProjectWithRepository)
assert project.respond_to?(:id)
assert_equal 1, project.id
assert project.respond_to?(:identifier)
assert_equal 'ecookbook', project.identifier
assert project.respond_to?(:name)
assert_equal 'eCookbook', project.name
assert project.respond_to?(:is_public)
assert project.is_public
assert project.respond_to?(:repository)
assert project.repository.is_a?(Repository)
end
def test_repository_created