From f24dc2f4f114e97c3a4a4ac75ba702c20059f8cb Mon Sep 17 00:00:00 2001 From: Philipp Tessenow Date: Mon, 15 Apr 2013 16:43:16 +0200 Subject: [PATCH] attempt to fix a constant not defined error when executing mysql unit tests --- test/functional/admin_controller_test.rb | 1 + test/functional/application_controller_test.rb | 1 + test/functional/attachments_controller_test.rb | 1 + test/functional/auth_sources_controller_test.rb | 1 + test/functional/boards_controller_test.rb | 1 + test/functional/custom_fields_controller_test.rb | 1 + test/functional/documents_controller_test.rb | 1 + test/functional/enumerations_controller_test.rb | 1 + test/functional/files_controller_test.rb | 1 + test/functional/groups_controller_test.rb | 1 + test/functional/issue_categories_controller_test.rb | 1 + test/functional/issue_relations_controller_test.rb | 1 + test/functional/issues/moves_controller_test.rb | 1 + test/functional/issues/reports_controller_test.rb | 1 + test/functional/issues_controller_test.rb | 1 + test/functional/issues_controller_transaction_test.rb | 1 + test/functional/journals_controller_test.rb | 1 + test/functional/ldap_auth_sources_controller_test.rb | 1 + test/functional/mail_handler_controller_test.rb | 1 + test/functional/members_controller_test.rb | 1 + test/functional/messages_controller_test.rb | 1 + test/functional/my_controller_test.rb | 1 + test/functional/news/comments_controller_test.rb | 1 + test/functional/news_controller_test.rb | 1 + test/functional/project_enumerations_controller_test.rb | 1 + test/functional/projects_controller_test.rb | 1 + test/functional/queries_controller_test.rb | 1 + test/functional/repositories_controller_test.rb | 1 + test/functional/repositories_filesystem_controller_test.rb | 1 + test/functional/repositories_git_controller_test.rb | 1 + test/functional/repositories_subversion_controller_test.rb | 1 + test/functional/roles_controller_test.rb | 1 + test/functional/search_controller_test.rb | 1 + test/functional/settings_controller_test.rb | 1 + test/functional/sys_controller_test.rb | 1 + test/functional/timelog_controller_test.rb | 1 + test/functional/trackers_controller_test.rb | 1 + test/functional/user_mailer_test.rb | 3 ++- test/functional/users_controller_test.rb | 1 + test/functional/versions_controller_test.rb | 1 + test/functional/watchers_controller_test.rb | 1 + test/functional/welcome_controller_test.rb | 1 + test/functional/wiki_controller_test.rb | 1 + test/functional/wikis_controller_test.rb | 1 + test/functional/workflows_controller_test.rb | 1 + test/test_helper.rb | 4 +++- 46 files changed, 49 insertions(+), 2 deletions(-) diff --git a/test/functional/admin_controller_test.rb b/test/functional/admin_controller_test.rb index b416bb7edb..bbbf37431d 100644 --- a/test/functional/admin_controller_test.rb +++ b/test/functional/admin_controller_test.rb @@ -21,6 +21,7 @@ class AdminControllerTest < ActionController::TestCase fixtures :all def setup + super @controller = AdminController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new diff --git a/test/functional/application_controller_test.rb b/test/functional/application_controller_test.rb index 52e56ccc45..def057322d 100644 --- a/test/functional/application_controller_test.rb +++ b/test/functional/application_controller_test.rb @@ -21,6 +21,7 @@ class ApplicationControllerTest < ActionController::TestCase include Redmine::I18n def setup + super @controller = ApplicationController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new diff --git a/test/functional/attachments_controller_test.rb b/test/functional/attachments_controller_test.rb index 283c3487bf..96794f04dc 100644 --- a/test/functional/attachments_controller_test.rb +++ b/test/functional/attachments_controller_test.rb @@ -23,6 +23,7 @@ class AttachmentsControllerTest < ActionController::TestCase fixtures :all def setup + super @controller = AttachmentsController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new diff --git a/test/functional/auth_sources_controller_test.rb b/test/functional/auth_sources_controller_test.rb index a8ca1d5615..422286683d 100644 --- a/test/functional/auth_sources_controller_test.rb +++ b/test/functional/auth_sources_controller_test.rb @@ -18,6 +18,7 @@ class AuthSourcesControllerTest < ActionController::TestCase fixtures :all def setup + super @request.session[:user_id] = 1 end diff --git a/test/functional/boards_controller_test.rb b/test/functional/boards_controller_test.rb index 903882ae80..4f4f8109f8 100644 --- a/test/functional/boards_controller_test.rb +++ b/test/functional/boards_controller_test.rb @@ -21,6 +21,7 @@ class BoardsControllerTest < ActionController::TestCase fixtures :all def setup + super @controller = BoardsController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new diff --git a/test/functional/custom_fields_controller_test.rb b/test/functional/custom_fields_controller_test.rb index c08c0dbf32..e6665eeeb4 100644 --- a/test/functional/custom_fields_controller_test.rb +++ b/test/functional/custom_fields_controller_test.rb @@ -22,6 +22,7 @@ class CustomFieldsControllerTest < ActionController::TestCase fixtures :all def setup + super @controller = CustomFieldsController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new diff --git a/test/functional/documents_controller_test.rb b/test/functional/documents_controller_test.rb index 615ff8fd61..c1cf7b5b4a 100644 --- a/test/functional/documents_controller_test.rb +++ b/test/functional/documents_controller_test.rb @@ -21,6 +21,7 @@ class DocumentsControllerTest < ActionController::TestCase fixtures :all def setup + super @controller = DocumentsController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new diff --git a/test/functional/enumerations_controller_test.rb b/test/functional/enumerations_controller_test.rb index 093937c585..3ff8c8bb29 100644 --- a/test/functional/enumerations_controller_test.rb +++ b/test/functional/enumerations_controller_test.rb @@ -21,6 +21,7 @@ class EnumerationsControllerTest < ActionController::TestCase fixtures :all def setup + super @controller = EnumerationsController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new diff --git a/test/functional/files_controller_test.rb b/test/functional/files_controller_test.rb index d6eeab5447..8cef35f8f5 100644 --- a/test/functional/files_controller_test.rb +++ b/test/functional/files_controller_test.rb @@ -18,6 +18,7 @@ class FilesControllerTest < ActionController::TestCase fixtures :all def setup + super @controller = FilesController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new diff --git a/test/functional/groups_controller_test.rb b/test/functional/groups_controller_test.rb index 32d8d26b61..21c2c61633 100644 --- a/test/functional/groups_controller_test.rb +++ b/test/functional/groups_controller_test.rb @@ -21,6 +21,7 @@ class GroupsControllerTest < ActionController::TestCase fixtures :all def setup + super @controller = GroupsController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new diff --git a/test/functional/issue_categories_controller_test.rb b/test/functional/issue_categories_controller_test.rb index f58193a837..12fe62b1f9 100644 --- a/test/functional/issue_categories_controller_test.rb +++ b/test/functional/issue_categories_controller_test.rb @@ -21,6 +21,7 @@ class IssueCategoriesControllerTest < ActionController::TestCase fixtures :all def setup + super @controller = IssueCategoriesController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new diff --git a/test/functional/issue_relations_controller_test.rb b/test/functional/issue_relations_controller_test.rb index 034096b47b..b831ba3fc0 100644 --- a/test/functional/issue_relations_controller_test.rb +++ b/test/functional/issue_relations_controller_test.rb @@ -23,6 +23,7 @@ class IssueRelationsControllerTest < ActionController::TestCase fixtures :all def setup + super @controller = IssueRelationsController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new diff --git a/test/functional/issues/moves_controller_test.rb b/test/functional/issues/moves_controller_test.rb index aab9671eeb..ee3393279d 100644 --- a/test/functional/issues/moves_controller_test.rb +++ b/test/functional/issues/moves_controller_test.rb @@ -18,6 +18,7 @@ class Issues::MovesControllerTest < ActionController::TestCase fixtures :all def setup + super User.current = nil end diff --git a/test/functional/issues/reports_controller_test.rb b/test/functional/issues/reports_controller_test.rb index aed671db8d..daa0f9d5d5 100644 --- a/test/functional/issues/reports_controller_test.rb +++ b/test/functional/issues/reports_controller_test.rb @@ -22,6 +22,7 @@ class Issues::ReportsControllerTest < ActionController::TestCase fixtures :all def setup + super @controller = Issues::ReportsController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index 4d88aab761..da50301da7 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -21,6 +21,7 @@ class IssuesControllerTest < ActionController::TestCase fixtures :all def setup + super @controller = IssuesController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new diff --git a/test/functional/issues_controller_transaction_test.rb b/test/functional/issues_controller_transaction_test.rb index b4ab0fcbc4..dca97c68f3 100644 --- a/test/functional/issues_controller_transaction_test.rb +++ b/test/functional/issues_controller_transaction_test.rb @@ -23,6 +23,7 @@ class IssuesControllerTransactionTest < ActionController::TestCase self.use_transactional_fixtures = false def setup + super @controller = IssuesController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new diff --git a/test/functional/journals_controller_test.rb b/test/functional/journals_controller_test.rb index a821088032..9bf5b1790b 100644 --- a/test/functional/journals_controller_test.rb +++ b/test/functional/journals_controller_test.rb @@ -21,6 +21,7 @@ class JournalsControllerTest < ActionController::TestCase fixtures :all def setup + super @controller = JournalsController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new diff --git a/test/functional/ldap_auth_sources_controller_test.rb b/test/functional/ldap_auth_sources_controller_test.rb index 914ec512d2..0835985720 100644 --- a/test/functional/ldap_auth_sources_controller_test.rb +++ b/test/functional/ldap_auth_sources_controller_test.rb @@ -18,6 +18,7 @@ class LdapAuthSourcesControllerTest < ActionController::TestCase fixtures :all def setup + super @request.session[:user_id] = 1 end diff --git a/test/functional/mail_handler_controller_test.rb b/test/functional/mail_handler_controller_test.rb index fd54e75c25..98b60e93af 100644 --- a/test/functional/mail_handler_controller_test.rb +++ b/test/functional/mail_handler_controller_test.rb @@ -23,6 +23,7 @@ class MailHandlerControllerTest < ActionController::TestCase FIXTURES_PATH = File.dirname(__FILE__) + '/../fixtures/mail_handler' def setup + super @controller = MailHandlerController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new diff --git a/test/functional/members_controller_test.rb b/test/functional/members_controller_test.rb index a1cb73a79c..9afe3f882f 100644 --- a/test/functional/members_controller_test.rb +++ b/test/functional/members_controller_test.rb @@ -22,6 +22,7 @@ class MembersControllerTest < ActionController::TestCase fixtures :all def setup + super @controller = MembersController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new diff --git a/test/functional/messages_controller_test.rb b/test/functional/messages_controller_test.rb index 29233b857e..39e8de75d4 100644 --- a/test/functional/messages_controller_test.rb +++ b/test/functional/messages_controller_test.rb @@ -21,6 +21,7 @@ class MessagesControllerTest < ActionController::TestCase fixtures :all def setup + super @controller = MessagesController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new diff --git a/test/functional/my_controller_test.rb b/test/functional/my_controller_test.rb index eb37dda380..88926a23be 100644 --- a/test/functional/my_controller_test.rb +++ b/test/functional/my_controller_test.rb @@ -21,6 +21,7 @@ class MyControllerTest < ActionController::TestCase fixtures :all def setup + super @controller = MyController.new @request = ActionController::TestRequest.new @request.session[:user_id] = 2 diff --git a/test/functional/news/comments_controller_test.rb b/test/functional/news/comments_controller_test.rb index ff95598341..d54cb9fe9d 100644 --- a/test/functional/news/comments_controller_test.rb +++ b/test/functional/news/comments_controller_test.rb @@ -17,6 +17,7 @@ class News::CommentsControllerTest < ActionController::TestCase fixtures :all def setup + super User.current = nil end diff --git a/test/functional/news_controller_test.rb b/test/functional/news_controller_test.rb index aca5dc572d..d0894b10cb 100644 --- a/test/functional/news_controller_test.rb +++ b/test/functional/news_controller_test.rb @@ -21,6 +21,7 @@ class NewsControllerTest < ActionController::TestCase fixtures :all def setup + super @controller = NewsController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new diff --git a/test/functional/project_enumerations_controller_test.rb b/test/functional/project_enumerations_controller_test.rb index c6276ed744..8b921c7b2f 100644 --- a/test/functional/project_enumerations_controller_test.rb +++ b/test/functional/project_enumerations_controller_test.rb @@ -18,6 +18,7 @@ class ProjectEnumerationsControllerTest < ActionController::TestCase fixtures :all def setup + super @request.session[:user_id] = nil Setting.default_language = 'en' end diff --git a/test/functional/projects_controller_test.rb b/test/functional/projects_controller_test.rb index 85737bbc74..470a5cd811 100644 --- a/test/functional/projects_controller_test.rb +++ b/test/functional/projects_controller_test.rb @@ -23,6 +23,7 @@ class ProjectsControllerTest < ActionController::TestCase fixtures :all def setup + super @controller = ProjectsController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new diff --git a/test/functional/queries_controller_test.rb b/test/functional/queries_controller_test.rb index e767c37720..19d232e9b7 100644 --- a/test/functional/queries_controller_test.rb +++ b/test/functional/queries_controller_test.rb @@ -21,6 +21,7 @@ class QueriesControllerTest < ActionController::TestCase fixtures :all def setup + super @controller = QueriesController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new diff --git a/test/functional/repositories_controller_test.rb b/test/functional/repositories_controller_test.rb index 865ec40a44..4bec021b04 100644 --- a/test/functional/repositories_controller_test.rb +++ b/test/functional/repositories_controller_test.rb @@ -21,6 +21,7 @@ class RepositoriesControllerTest < ActionController::TestCase fixtures :all def setup + super @controller = RepositoriesController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new diff --git a/test/functional/repositories_filesystem_controller_test.rb b/test/functional/repositories_filesystem_controller_test.rb index db98bd1143..1d8937a5ba 100644 --- a/test/functional/repositories_filesystem_controller_test.rb +++ b/test/functional/repositories_filesystem_controller_test.rb @@ -25,6 +25,7 @@ class RepositoriesFilesystemControllerTest < ActionController::TestCase PRJ_ID = 3 def setup + super @controller = RepositoriesController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new diff --git a/test/functional/repositories_git_controller_test.rb b/test/functional/repositories_git_controller_test.rb index 9a94c096df..a25bd5ae60 100644 --- a/test/functional/repositories_git_controller_test.rb +++ b/test/functional/repositories_git_controller_test.rb @@ -25,6 +25,7 @@ class RepositoriesGitControllerTest < ActionController::TestCase REPOSITORY_PATH.gsub!(/\//, "\\") if Redmine::Platform.mswin? def setup + super @controller = RepositoriesController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new diff --git a/test/functional/repositories_subversion_controller_test.rb b/test/functional/repositories_subversion_controller_test.rb index 87d9504444..d27180c3e8 100644 --- a/test/functional/repositories_subversion_controller_test.rb +++ b/test/functional/repositories_subversion_controller_test.rb @@ -23,6 +23,7 @@ class RepositoriesSubversionControllerTest < ActionController::TestCase PRJ_ID = 3 def setup + super @controller = RepositoriesController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new diff --git a/test/functional/roles_controller_test.rb b/test/functional/roles_controller_test.rb index a2fe93fed0..0cf560816c 100644 --- a/test/functional/roles_controller_test.rb +++ b/test/functional/roles_controller_test.rb @@ -21,6 +21,7 @@ class RolesControllerTest < ActionController::TestCase fixtures :all def setup + super @controller = RolesController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new diff --git a/test/functional/search_controller_test.rb b/test/functional/search_controller_test.rb index 018961cc15..7656152533 100644 --- a/test/functional/search_controller_test.rb +++ b/test/functional/search_controller_test.rb @@ -22,6 +22,7 @@ class SearchControllerTest < ActionController::TestCase fixtures :all def setup + super @controller = SearchController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new diff --git a/test/functional/settings_controller_test.rb b/test/functional/settings_controller_test.rb index ffd15d3e54..f9e9db856c 100644 --- a/test/functional/settings_controller_test.rb +++ b/test/functional/settings_controller_test.rb @@ -22,6 +22,7 @@ class SettingsControllerTest < ActionController::TestCase fixtures :all def setup + super @controller = SettingsController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new diff --git a/test/functional/sys_controller_test.rb b/test/functional/sys_controller_test.rb index ee25979c25..6196b5a2cc 100644 --- a/test/functional/sys_controller_test.rb +++ b/test/functional/sys_controller_test.rb @@ -23,6 +23,7 @@ class SysControllerTest < ActionController::TestCase fixtures :all def setup + super @controller = SysController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new diff --git a/test/functional/timelog_controller_test.rb b/test/functional/timelog_controller_test.rb index 64d3223145..08b7193471 100644 --- a/test/functional/timelog_controller_test.rb +++ b/test/functional/timelog_controller_test.rb @@ -22,6 +22,7 @@ class TimelogControllerTest < ActionController::TestCase fixtures :all def setup + super @controller = TimelogController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new diff --git a/test/functional/trackers_controller_test.rb b/test/functional/trackers_controller_test.rb index 1a260b1205..e7f739dc0e 100644 --- a/test/functional/trackers_controller_test.rb +++ b/test/functional/trackers_controller_test.rb @@ -21,6 +21,7 @@ class TrackersControllerTest < ActionController::TestCase fixtures :all def setup + super @controller = TrackersController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new diff --git a/test/functional/user_mailer_test.rb b/test/functional/user_mailer_test.rb index 4e2d557f87..486b6c9b40 100644 --- a/test/functional/user_mailer_test.rb +++ b/test/functional/user_mailer_test.rb @@ -3,7 +3,8 @@ require File.expand_path('../../test_helper', __FILE__) class UserMailerTest < ActionMailer::TestCase include ActionDispatch::Assertions::SelectorAssertions - setup do + def setup + super Setting.mail_from = 'john@doe.com' Setting.host_name = 'mydomain.foo' Setting.protocol = 'http' diff --git a/test/functional/users_controller_test.rb b/test/functional/users_controller_test.rb index 4265b2a34e..782d04cb9f 100644 --- a/test/functional/users_controller_test.rb +++ b/test/functional/users_controller_test.rb @@ -24,6 +24,7 @@ class UsersControllerTest < ActionController::TestCase fixtures :all def setup + super @controller = UsersController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new diff --git a/test/functional/versions_controller_test.rb b/test/functional/versions_controller_test.rb index 691224ddec..b0c6b4c735 100644 --- a/test/functional/versions_controller_test.rb +++ b/test/functional/versions_controller_test.rb @@ -22,6 +22,7 @@ class VersionsControllerTest < ActionController::TestCase fixtures :all def setup + super @controller = VersionsController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new diff --git a/test/functional/watchers_controller_test.rb b/test/functional/watchers_controller_test.rb index ae73e18aab..b099ef4cbe 100644 --- a/test/functional/watchers_controller_test.rb +++ b/test/functional/watchers_controller_test.rb @@ -21,6 +21,7 @@ class WatchersControllerTest < ActionController::TestCase fixtures :all def setup + super @controller = WatchersController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new diff --git a/test/functional/welcome_controller_test.rb b/test/functional/welcome_controller_test.rb index ecfe550773..f20ec70799 100644 --- a/test/functional/welcome_controller_test.rb +++ b/test/functional/welcome_controller_test.rb @@ -21,6 +21,7 @@ class WelcomeControllerTest < ActionController::TestCase fixtures :all def setup + super @controller = WelcomeController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new diff --git a/test/functional/wiki_controller_test.rb b/test/functional/wiki_controller_test.rb index 027eb798f7..6802b872f4 100644 --- a/test/functional/wiki_controller_test.rb +++ b/test/functional/wiki_controller_test.rb @@ -21,6 +21,7 @@ class WikiControllerTest < ActionController::TestCase fixtures :all def setup + super @controller = WikiController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new diff --git a/test/functional/wikis_controller_test.rb b/test/functional/wikis_controller_test.rb index 8c2b6c542a..8a4238d6f3 100644 --- a/test/functional/wikis_controller_test.rb +++ b/test/functional/wikis_controller_test.rb @@ -21,6 +21,7 @@ class WikisControllerTest < ActionController::TestCase fixtures :all def setup + super @controller = WikisController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new diff --git a/test/functional/workflows_controller_test.rb b/test/functional/workflows_controller_test.rb index 081158ac74..57bc7b0ea7 100644 --- a/test/functional/workflows_controller_test.rb +++ b/test/functional/workflows_controller_test.rb @@ -21,6 +21,7 @@ class WorkflowsControllerTest < ActionController::TestCase fixtures :all def setup + super @controller = WorkflowsController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new diff --git a/test/test_helper.rb b/test/test_helper.rb index 0e3f074acd..f49efc73b0 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -65,7 +65,9 @@ class ActiveSupport::TestCase # Ugly H4X to convince postgresql to update its sequences after bulk loading fixtures # TODO: remove this when we got rid of the fixtures ActiveRecord::Base.descendants.each do |model| - if model.table_name and ActiveRecord::Base.connection.is_a?(ActiveRecord::ConnectionAdapters::PostgreSQLAdapter) + if model.table_name \ + and defined?(ActiveRecord::ConnectionAdapters::PostgreSQLAdapter) \ + and ActiveRecord::Base.connection.is_a?(ActiveRecord::ConnectionAdapters::PostgreSQLAdapter) ActiveRecord::Base.connection.reset_pk_sequence!(model.table_name) end end