Jason Guiditta
2009-Jun-16 15:10 UTC
[Ovirt-devel] [PATCH server] Fix errors in controller tests.
A bunch of controllers were not extending ActionController::TestCase, and instead were just using the basic test/unit testcase, so we were not getting some of the rails baked-in stuff. Signed-off-by: Jason Guiditta <jguiditt at redhat.com> --- src/test/functional/host_controller_test.rb | 2 +- src/test/functional/nic_controller_test.rb | 2 +- src/test/functional/permission_controller_test.rb | 5 +++-- src/test/functional/quota_controller_test.rb | 2 +- src/test/functional/storage_controller_test.rb | 2 +- src/test/functional/task_controller_test.rb | 2 +- src/test/functional/vm_controller_test.rb | 2 +- 7 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/test/functional/host_controller_test.rb b/src/test/functional/host_controller_test.rb index caf198d..dc9891c 100644 --- a/src/test/functional/host_controller_test.rb +++ b/src/test/functional/host_controller_test.rb @@ -23,7 +23,7 @@ require 'host_controller' # Re-raise errors caught by the controller. class HostController; def rescue_action(e) raise e end; end -class HostControllerTest < Test::Unit::TestCase +class HostControllerTest < ActionController::TestCase fixtures :hosts, :pools, :privileges, :roles, :permissions def setup diff --git a/src/test/functional/nic_controller_test.rb b/src/test/functional/nic_controller_test.rb index 59183ba..60b5670 100644 --- a/src/test/functional/nic_controller_test.rb +++ b/src/test/functional/nic_controller_test.rb @@ -23,7 +23,7 @@ require 'nic_controller' # Re-raise errors caught by the controller. class NicController; def rescue_action(e) raise e end; end -class NicControllerTest < Test::Unit::TestCase +class NicControllerTest < ActionController::TestCase fixtures :privileges, :roles, :permissions, :pools, :nics def setup diff --git a/src/test/functional/permission_controller_test.rb b/src/test/functional/permission_controller_test.rb index 0885890..49bf1ef 100644 --- a/src/test/functional/permission_controller_test.rb +++ b/src/test/functional/permission_controller_test.rb @@ -1,6 +1,7 @@ # Copyright (C) 2008 Red Hat, Inc. -# Written by Scott Seago <sseago at redhat.com> +# Written by Scott Seago <sseago at redhat.com>, +# Jason Guiditta <jguiditt at redhat.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -23,7 +24,7 @@ require 'permission_controller' # Re-raise errors caught by the controller. class PermissionController; def rescue_action(e) raise e end; end -class PermissionControllerTest < Test::Unit::TestCase +class PermissionControllerTest < ActionController::TestCase fixtures :privileges, :roles, :permissions, :pools def setup diff --git a/src/test/functional/quota_controller_test.rb b/src/test/functional/quota_controller_test.rb index 1496652..35f23c0 100644 --- a/src/test/functional/quota_controller_test.rb +++ b/src/test/functional/quota_controller_test.rb @@ -23,7 +23,7 @@ require 'quota_controller' # Re-raise errors caught by the controller. class QuotaController; def rescue_action(e) raise e end; end -class QuotaControllerTest < Test::Unit::TestCase +class QuotaControllerTest < ActionController::TestCase fixtures :quotas, :pools def setup diff --git a/src/test/functional/storage_controller_test.rb b/src/test/functional/storage_controller_test.rb index fcf0293..e10a662 100644 --- a/src/test/functional/storage_controller_test.rb +++ b/src/test/functional/storage_controller_test.rb @@ -23,7 +23,7 @@ require 'storage_controller' # Re-raise errors caught by the controller. class StorageController; def rescue_action(e) raise e end; end -class StorageControllerTest < Test::Unit::TestCase +class StorageControllerTest < ActionController::TestCase fixtures :privileges, :roles, :permissions, :pools, :storage_volumes, :storage_pools diff --git a/src/test/functional/task_controller_test.rb b/src/test/functional/task_controller_test.rb index 3b90756..a2a6393 100644 --- a/src/test/functional/task_controller_test.rb +++ b/src/test/functional/task_controller_test.rb @@ -23,7 +23,7 @@ require 'task_controller' # Re-raise errors caught by the controller. class TaskController; def rescue_action(e) raise e end; end -class TaskControllerTest < Test::Unit::TestCase +class TaskControllerTest < ActionController::TestCase fixtures :tasks, :vms, :pools def setup diff --git a/src/test/functional/vm_controller_test.rb b/src/test/functional/vm_controller_test.rb index a059c50..1271851 100644 --- a/src/test/functional/vm_controller_test.rb +++ b/src/test/functional/vm_controller_test.rb @@ -23,7 +23,7 @@ require 'vm_controller' # Re-raise errors caught by the controller. class VmController; def rescue_action(e) raise e end; end -class VmControllerTest < Test::Unit::TestCase +class VmControllerTest < ActionController::TestCase fixtures :privileges, :roles, :permissions, :pools, :vms def setup -- 1.6.0.6