summaryrefslogtreecommitdiffstats
path: root/test/functional
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-12-03 22:23:23 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-12-03 22:23:23 +0000
commit4cc4e8bfd3a87ec4434d13e5091c0a7dd4e69233 (patch)
treef86d4fffe8d7427ba0cfb47e2e70d361aa945121 /test/functional
parent349049a539601b0095783befdef4ae1106d85c98 (diff)
downloadredmine-4cc4e8bfd3a87ec4434d13e5091c0a7dd4e69233.tar.gz
redmine-4cc4e8bfd3a87ec4434d13e5091c0a7dd4e69233.zip
Functional tests cleanup.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10936 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/account_controller_test.rb7
-rw-r--r--test/functional/activities_controller_test.rb17
-rw-r--r--test/functional/attachments_controller_test.rb7
-rw-r--r--test/functional/auto_completes_controller_test.rb17
-rw-r--r--test/functional/calendars_controller_test.rb17
-rw-r--r--test/functional/context_menus_controller_test.rb17
-rw-r--r--test/functional/files_controller_test.rb20
-rw-r--r--test/functional/gantts_controller_test.rb136
-rw-r--r--test/functional/issue_categories_controller_test.rb7
-rw-r--r--test/functional/issue_statuses_controller_test.rb25
-rw-r--r--test/functional/issues_controller_test.rb4
-rw-r--r--test/functional/issues_controller_transaction_test.rb4
-rw-r--r--test/functional/journals_controller_test.rb7
-rw-r--r--test/functional/mail_handler_controller_test.rb7
-rw-r--r--test/functional/members_controller_test.rb8
-rw-r--r--test/functional/messages_controller_test.rb7
-rw-r--r--test/functional/news_controller_test.rb7
-rw-r--r--test/functional/project_enumerations_controller_test.rb17
-rw-r--r--test/functional/projects_controller_test.rb7
-rw-r--r--test/functional/reports_controller_test.rb3
-rw-r--r--test/functional/repositories_controller_test.rb7
-rw-r--r--test/functional/roles_controller_test.rb3
-rw-r--r--test/functional/search_controller_test.rb24
-rw-r--r--test/functional/settings_controller_test.rb7
-rw-r--r--test/functional/sys_controller_test.rb8
-rw-r--r--test/functional/time_entry_reports_controller_test.rb17
-rw-r--r--test/functional/timelog_controller_test.rb10
-rw-r--r--test/functional/trackers_controller_test.rb7
-rw-r--r--test/functional/users_controller_test.rb7
-rw-r--r--test/functional/versions_controller_test.rb7
-rw-r--r--test/functional/watchers_controller_test.rb7
-rw-r--r--test/functional/welcome_controller_test.rb7
-rw-r--r--test/functional/wiki_controller_test.rb7
-rw-r--r--test/functional/wikis_controller_test.rb7
-rw-r--r--test/functional/workflows_controller_test.rb7
35 files changed, 222 insertions, 251 deletions
diff --git a/test/functional/account_controller_test.rb b/test/functional/account_controller_test.rb
index c715fa80d..08960b451 100644
--- a/test/functional/account_controller_test.rb
+++ b/test/functional/account_controller_test.rb
@@ -16,18 +16,11 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require File.expand_path('../../test_helper', __FILE__)
-require 'account_controller'
-
-# Re-raise errors caught by the controller.
-class AccountController; def rescue_action(e) raise e end; end
class AccountControllerTest < ActionController::TestCase
fixtures :users, :roles
def setup
- @controller = AccountController.new
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
User.current = nil
end
diff --git a/test/functional/activities_controller_test.rb b/test/functional/activities_controller_test.rb
index 234ea7c57..b5effcd30 100644
--- a/test/functional/activities_controller_test.rb
+++ b/test/functional/activities_controller_test.rb
@@ -1,3 +1,20 @@
+# Redmine - project management software
+# Copyright (C) 2006-2012 Jean-Philippe Lang
+#
+# 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 the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
require File.expand_path('../../test_helper', __FILE__)
class ActivitiesControllerTest < ActionController::TestCase
diff --git a/test/functional/attachments_controller_test.rb b/test/functional/attachments_controller_test.rb
index 8c0375d6d..ac66a6454 100644
--- a/test/functional/attachments_controller_test.rb
+++ b/test/functional/attachments_controller_test.rb
@@ -18,10 +18,6 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require File.expand_path('../../test_helper', __FILE__)
-require 'attachments_controller'
-
-# Re-raise errors caught by the controller.
-class AttachmentsController; def rescue_action(e) raise e end; end
class AttachmentsControllerTest < ActionController::TestCase
fixtures :users, :projects, :roles, :members, :member_roles,
@@ -29,9 +25,6 @@ class AttachmentsControllerTest < ActionController::TestCase
:versions, :wiki_pages, :wikis, :documents
def setup
- @controller = AttachmentsController.new
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
User.current = nil
set_fixtures_attachments_directory
end
diff --git a/test/functional/auto_completes_controller_test.rb b/test/functional/auto_completes_controller_test.rb
index 0be93b049..099cf64ef 100644
--- a/test/functional/auto_completes_controller_test.rb
+++ b/test/functional/auto_completes_controller_test.rb
@@ -1,3 +1,20 @@
+# Redmine - project management software
+# Copyright (C) 2006-2012 Jean-Philippe Lang
+#
+# 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 the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
require File.expand_path('../../test_helper', __FILE__)
class AutoCompletesControllerTest < ActionController::TestCase
diff --git a/test/functional/calendars_controller_test.rb b/test/functional/calendars_controller_test.rb
index b1402dfb3..2855afbbf 100644
--- a/test/functional/calendars_controller_test.rb
+++ b/test/functional/calendars_controller_test.rb
@@ -1,3 +1,20 @@
+# Redmine - project management software
+# Copyright (C) 2006-2012 Jean-Philippe Lang
+#
+# 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 the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
require File.expand_path('../../test_helper', __FILE__)
class CalendarsControllerTest < ActionController::TestCase
diff --git a/test/functional/context_menus_controller_test.rb b/test/functional/context_menus_controller_test.rb
index 55feeca43..dc8406b79 100644
--- a/test/functional/context_menus_controller_test.rb
+++ b/test/functional/context_menus_controller_test.rb
@@ -1,3 +1,20 @@
+# Redmine - project management software
+# Copyright (C) 2006-2012 Jean-Philippe Lang
+#
+# 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 the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
require File.expand_path('../../test_helper', __FILE__)
class ContextMenusControllerTest < ActionController::TestCase
diff --git a/test/functional/files_controller_test.rb b/test/functional/files_controller_test.rb
index 8691a1818..045fa7756 100644
--- a/test/functional/files_controller_test.rb
+++ b/test/functional/files_controller_test.rb
@@ -1,3 +1,20 @@
+# Redmine - project management software
+# Copyright (C) 2006-2012 Jean-Philippe Lang
+#
+# 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 the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
require File.expand_path('../../test_helper', __FILE__)
class FilesControllerTest < ActionController::TestCase
@@ -14,9 +31,6 @@ class FilesControllerTest < ActionController::TestCase
:versions
def setup
- @controller = FilesController.new
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
@request.session[:user_id] = nil
Setting.default_language = 'en'
end
diff --git a/test/functional/gantts_controller_test.rb b/test/functional/gantts_controller_test.rb
index 98dca862b..902eaff26 100644
--- a/test/functional/gantts_controller_test.rb
+++ b/test/functional/gantts_controller_test.rb
@@ -28,80 +28,80 @@ class GanttsControllerTest < ActionController::TestCase
:workflows,
:versions
- def test_gantt_should_work
- i2 = Issue.find(2)
- i2.update_attribute(:due_date, 1.month.from_now)
- get :show, :project_id => 1
- assert_response :success
- assert_template 'gantts/show'
- assert_not_nil assigns(:gantt)
- # Issue with start and due dates
- i = Issue.find(1)
- assert_not_nil i.due_date
- assert_select "div a.issue", /##{i.id}/
- # Issue with on a targeted version should not be in the events but loaded in the html
- i = Issue.find(2)
- assert_select "div a.issue", /##{i.id}/
- end
+ def test_gantt_should_work
+ i2 = Issue.find(2)
+ i2.update_attribute(:due_date, 1.month.from_now)
+ get :show, :project_id => 1
+ assert_response :success
+ assert_template 'gantts/show'
+ assert_not_nil assigns(:gantt)
+ # Issue with start and due dates
+ i = Issue.find(1)
+ assert_not_nil i.due_date
+ assert_select "div a.issue", /##{i.id}/
+ # Issue with on a targeted version should not be in the events but loaded in the html
+ i = Issue.find(2)
+ assert_select "div a.issue", /##{i.id}/
+ end
- def test_gantt_should_work_without_issue_due_dates
- Issue.update_all("due_date = NULL")
- get :show, :project_id => 1
- assert_response :success
- assert_template 'gantts/show'
- assert_not_nil assigns(:gantt)
- end
+ def test_gantt_should_work_without_issue_due_dates
+ Issue.update_all("due_date = NULL")
+ get :show, :project_id => 1
+ assert_response :success
+ assert_template 'gantts/show'
+ assert_not_nil assigns(:gantt)
+ end
- def test_gantt_should_work_without_issue_and_version_due_dates
- Issue.update_all("due_date = NULL")
- Version.update_all("effective_date = NULL")
- get :show, :project_id => 1
- assert_response :success
- assert_template 'gantts/show'
- assert_not_nil assigns(:gantt)
- end
+ def test_gantt_should_work_without_issue_and_version_due_dates
+ Issue.update_all("due_date = NULL")
+ Version.update_all("effective_date = NULL")
+ get :show, :project_id => 1
+ assert_response :success
+ assert_template 'gantts/show'
+ assert_not_nil assigns(:gantt)
+ end
- def test_gantt_should_work_cross_project
- get :show
- assert_response :success
- assert_template 'gantts/show'
- assert_not_nil assigns(:gantt)
- assert_not_nil assigns(:gantt).query
- assert_nil assigns(:gantt).project
- end
+ def test_gantt_should_work_cross_project
+ get :show
+ assert_response :success
+ assert_template 'gantts/show'
+ assert_not_nil assigns(:gantt)
+ assert_not_nil assigns(:gantt).query
+ assert_nil assigns(:gantt).project
+ end
- def test_gantt_should_not_disclose_private_projects
- get :show
- assert_response :success
- assert_template 'gantts/show'
- assert_tag 'a', :content => /eCookbook/
- # Root private project
- assert_no_tag 'a', {:content => /OnlineStore/}
- # Private children of a public project
- assert_no_tag 'a', :content => /Private child of eCookbook/
- end
+ def test_gantt_should_not_disclose_private_projects
+ get :show
+ assert_response :success
+ assert_template 'gantts/show'
+ assert_tag 'a', :content => /eCookbook/
+ # Root private project
+ assert_no_tag 'a', {:content => /OnlineStore/}
+ # Private children of a public project
+ assert_no_tag 'a', :content => /Private child of eCookbook/
+ end
- def test_gantt_should_export_to_pdf
- get :show, :project_id => 1, :format => 'pdf'
- assert_response :success
- assert_equal 'application/pdf', @response.content_type
- assert @response.body.starts_with?('%PDF')
- assert_not_nil assigns(:gantt)
- end
+ def test_gantt_should_export_to_pdf
+ get :show, :project_id => 1, :format => 'pdf'
+ assert_response :success
+ assert_equal 'application/pdf', @response.content_type
+ assert @response.body.starts_with?('%PDF')
+ assert_not_nil assigns(:gantt)
+ end
- def test_gantt_should_export_to_pdf_cross_project
- get :show, :format => 'pdf'
- assert_response :success
- assert_equal 'application/pdf', @response.content_type
- assert @response.body.starts_with?('%PDF')
- assert_not_nil assigns(:gantt)
- end
+ def test_gantt_should_export_to_pdf_cross_project
+ get :show, :format => 'pdf'
+ assert_response :success
+ assert_equal 'application/pdf', @response.content_type
+ assert @response.body.starts_with?('%PDF')
+ assert_not_nil assigns(:gantt)
+ end
- if Object.const_defined?(:Magick)
- def test_gantt_should_export_to_png
- get :show, :project_id => 1, :format => 'png'
- assert_response :success
- assert_equal 'image/png', @response.content_type
- end
+ if Object.const_defined?(:Magick)
+ def test_gantt_should_export_to_png
+ get :show, :project_id => 1, :format => 'png'
+ assert_response :success
+ assert_equal 'image/png', @response.content_type
end
+ end
end
diff --git a/test/functional/issue_categories_controller_test.rb b/test/functional/issue_categories_controller_test.rb
index 6f45cf1a6..db90e7d10 100644
--- a/test/functional/issue_categories_controller_test.rb
+++ b/test/functional/issue_categories_controller_test.rb
@@ -16,19 +16,12 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require File.expand_path('../../test_helper', __FILE__)
-require 'issue_categories_controller'
-
-# Re-raise errors caught by the controller.
-class IssueCategoriesController; def rescue_action(e) raise e end; end
class IssueCategoriesControllerTest < ActionController::TestCase
fixtures :projects, :users, :members, :member_roles, :roles, :enabled_modules, :issue_categories,
:issues
def setup
- @controller = IssueCategoriesController.new
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
User.current = nil
@request.session[:user_id] = 2
end
diff --git a/test/functional/issue_statuses_controller_test.rb b/test/functional/issue_statuses_controller_test.rb
index 1662413e0..0194be22e 100644
--- a/test/functional/issue_statuses_controller_test.rb
+++ b/test/functional/issue_statuses_controller_test.rb
@@ -1,17 +1,26 @@
-require File.expand_path('../../test_helper', __FILE__)
-require 'issue_statuses_controller'
-
-# Re-raise errors caught by the controller.
-class IssueStatusesController; def rescue_action(e) raise e end; end
+# Redmine - project management software
+# Copyright (C) 2006-2012 Jean-Philippe Lang
+#
+# 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 the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+require File.expand_path('../../test_helper', __FILE__)
class IssueStatusesControllerTest < ActionController::TestCase
fixtures :issue_statuses, :issues, :users
def setup
- @controller = IssueStatusesController.new
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
User.current = nil
@request.session[:user_id] = 1 # admin
end
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb
index 03e2b52c5..7efaa22e5 100644
--- a/test/functional/issues_controller_test.rb
+++ b/test/functional/issues_controller_test.rb
@@ -16,7 +16,6 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require File.expand_path('../../test_helper', __FILE__)
-require 'issues_controller'
class IssuesControllerTest < ActionController::TestCase
fixtures :projects,
@@ -48,9 +47,6 @@ class IssuesControllerTest < ActionController::TestCase
include Redmine::I18n
def setup
- @controller = IssuesController.new
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
User.current = nil
end
diff --git a/test/functional/issues_controller_transaction_test.rb b/test/functional/issues_controller_transaction_test.rb
index 20a3895ff..85c573f9d 100644
--- a/test/functional/issues_controller_transaction_test.rb
+++ b/test/functional/issues_controller_transaction_test.rb
@@ -19,6 +19,7 @@ require File.expand_path('../../test_helper', __FILE__)
require 'issues_controller'
class IssuesControllerTransactionTest < ActionController::TestCase
+ tests IssuesController
fixtures :projects,
:users,
:roles,
@@ -46,9 +47,6 @@ class IssuesControllerTransactionTest < ActionController::TestCase
self.use_transactional_fixtures = false
def setup
- @controller = IssuesController.new
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
User.current = nil
end
diff --git a/test/functional/journals_controller_test.rb b/test/functional/journals_controller_test.rb
index 5ba4725eb..110774d8a 100644
--- a/test/functional/journals_controller_test.rb
+++ b/test/functional/journals_controller_test.rb
@@ -16,19 +16,12 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require File.expand_path('../../test_helper', __FILE__)
-require 'journals_controller'
-
-# Re-raise errors caught by the controller.
-class JournalsController; def rescue_action(e) raise e end; end
class JournalsControllerTest < ActionController::TestCase
fixtures :projects, :users, :members, :member_roles, :roles, :issues, :journals, :journal_details, :enabled_modules,
:trackers, :issue_statuses, :enumerations, :custom_fields, :custom_values, :custom_fields_projects
def setup
- @controller = JournalsController.new
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
User.current = nil
end
diff --git a/test/functional/mail_handler_controller_test.rb b/test/functional/mail_handler_controller_test.rb
index b90b44b2e..efd696c32 100644
--- a/test/functional/mail_handler_controller_test.rb
+++ b/test/functional/mail_handler_controller_test.rb
@@ -16,10 +16,6 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require File.expand_path('../../test_helper', __FILE__)
-require 'mail_handler_controller'
-
-# Re-raise errors caught by the controller.
-class MailHandlerController; def rescue_action(e) raise e end; end
class MailHandlerControllerTest < ActionController::TestCase
fixtures :users, :projects, :enabled_modules, :roles, :members, :member_roles, :issues, :issue_statuses,
@@ -28,9 +24,6 @@ class MailHandlerControllerTest < ActionController::TestCase
FIXTURES_PATH = File.dirname(__FILE__) + '/../fixtures/mail_handler'
def setup
- @controller = MailHandlerController.new
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
User.current = nil
end
diff --git a/test/functional/members_controller_test.rb b/test/functional/members_controller_test.rb
index 55bbad5ce..cb9d45f8c 100644
--- a/test/functional/members_controller_test.rb
+++ b/test/functional/members_controller_test.rb
@@ -16,19 +16,11 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require File.expand_path('../../test_helper', __FILE__)
-require 'members_controller'
-
-# Re-raise errors caught by the controller.
-class MembersController; def rescue_action(e) raise e end; end
-
class MembersControllerTest < ActionController::TestCase
fixtures :projects, :members, :member_roles, :roles, :users
def setup
- @controller = MembersController.new
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
User.current = nil
@request.session[:user_id] = 2
end
diff --git a/test/functional/messages_controller_test.rb b/test/functional/messages_controller_test.rb
index 0276928e2..fa3af7917 100644
--- a/test/functional/messages_controller_test.rb
+++ b/test/functional/messages_controller_test.rb
@@ -16,18 +16,11 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require File.expand_path('../../test_helper', __FILE__)
-require 'messages_controller'
-
-# Re-raise errors caught by the controller.
-class MessagesController; def rescue_action(e) raise e end; end
class MessagesControllerTest < ActionController::TestCase
fixtures :projects, :users, :members, :member_roles, :roles, :boards, :messages, :enabled_modules
def setup
- @controller = MessagesController.new
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
User.current = nil
end
diff --git a/test/functional/news_controller_test.rb b/test/functional/news_controller_test.rb
index 4bc1a2a37..6d44bb1e7 100644
--- a/test/functional/news_controller_test.rb
+++ b/test/functional/news_controller_test.rb
@@ -16,18 +16,11 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require File.expand_path('../../test_helper', __FILE__)
-require 'news_controller'
-
-# Re-raise errors caught by the controller.
-class NewsController; def rescue_action(e) raise e end; end
class NewsControllerTest < ActionController::TestCase
fixtures :projects, :users, :roles, :members, :member_roles, :enabled_modules, :news, :comments
def setup
- @controller = NewsController.new
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
User.current = nil
end
diff --git a/test/functional/project_enumerations_controller_test.rb b/test/functional/project_enumerations_controller_test.rb
index a50f7968f..352f54251 100644
--- a/test/functional/project_enumerations_controller_test.rb
+++ b/test/functional/project_enumerations_controller_test.rb
@@ -1,3 +1,20 @@
+# Redmine - project management software
+# Copyright (C) 2006-2012 Jean-Philippe Lang
+#
+# 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 the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
require File.expand_path('../../test_helper', __FILE__)
class ProjectEnumerationsControllerTest < ActionController::TestCase
diff --git a/test/functional/projects_controller_test.rb b/test/functional/projects_controller_test.rb
index b606f4802..ac9312ca8 100644
--- a/test/functional/projects_controller_test.rb
+++ b/test/functional/projects_controller_test.rb
@@ -16,10 +16,6 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require File.expand_path('../../test_helper', __FILE__)
-require 'projects_controller'
-
-# Re-raise errors caught by the controller.
-class ProjectsController; def rescue_action(e) raise e end; end
class ProjectsControllerTest < ActionController::TestCase
fixtures :projects, :versions, :users, :roles, :members, :member_roles, :issues, :journals, :journal_details,
@@ -27,9 +23,6 @@ class ProjectsControllerTest < ActionController::TestCase
:attachments, :custom_fields, :custom_values, :time_entries
def setup
- @controller = ProjectsController.new
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
@request.session[:user_id] = nil
Setting.default_language = 'en'
end
diff --git a/test/functional/reports_controller_test.rb b/test/functional/reports_controller_test.rb
index c44a8a229..9dcbd8ff2 100644
--- a/test/functional/reports_controller_test.rb
+++ b/test/functional/reports_controller_test.rb
@@ -28,9 +28,6 @@ class ReportsControllerTest < ActionController::TestCase
:workflows,
:versions
- def setup
- end
-
def test_get_issue_report
get :issue_report, :id => 1
diff --git a/test/functional/repositories_controller_test.rb b/test/functional/repositories_controller_test.rb
index 3304127e1..61e0a0d40 100644
--- a/test/functional/repositories_controller_test.rb
+++ b/test/functional/repositories_controller_test.rb
@@ -16,10 +16,6 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require File.expand_path('../../test_helper', __FILE__)
-require 'repositories_controller'
-
-# Re-raise errors caught by the controller.
-class RepositoriesController; def rescue_action(e) raise e end; end
class RepositoriesControllerTest < ActionController::TestCase
fixtures :projects, :users, :roles, :members, :member_roles, :enabled_modules,
@@ -27,9 +23,6 @@ class RepositoriesControllerTest < ActionController::TestCase
:issue_categories, :enumerations, :custom_fields, :custom_values, :trackers
def setup
- @controller = RepositoriesController.new
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
User.current = nil
end
diff --git a/test/functional/roles_controller_test.rb b/test/functional/roles_controller_test.rb
index 68c573ac6..a2af70acd 100644
--- a/test/functional/roles_controller_test.rb
+++ b/test/functional/roles_controller_test.rb
@@ -21,9 +21,6 @@ class RolesControllerTest < ActionController::TestCase
fixtures :roles, :users, :members, :member_roles, :workflows, :trackers
def setup
- @controller = RolesController.new
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
User.current = nil
@request.session[:user_id] = 1 # admin
end
diff --git a/test/functional/search_controller_test.rb b/test/functional/search_controller_test.rb
index 40e140060..eb5f34a6a 100644
--- a/test/functional/search_controller_test.rb
+++ b/test/functional/search_controller_test.rb
@@ -1,8 +1,21 @@
-require File.expand_path('../../test_helper', __FILE__)
-require 'search_controller'
+# Redmine - project management software
+# Copyright (C) 2006-2012 Jean-Philippe Lang
+#
+# 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 the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-# Re-raise errors caught by the controller.
-class SearchController; def rescue_action(e) raise e end; end
+require File.expand_path('../../test_helper', __FILE__)
class SearchControllerTest < ActionController::TestCase
fixtures :projects, :enabled_modules, :roles, :users, :members, :member_roles,
@@ -11,9 +24,6 @@ class SearchControllerTest < ActionController::TestCase
:repositories, :changesets
def setup
- @controller = SearchController.new
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
User.current = nil
end
diff --git a/test/functional/settings_controller_test.rb b/test/functional/settings_controller_test.rb
index 034b902d0..94f199f1b 100644
--- a/test/functional/settings_controller_test.rb
+++ b/test/functional/settings_controller_test.rb
@@ -16,18 +16,11 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require File.expand_path('../../test_helper', __FILE__)
-require 'settings_controller'
-
-# Re-raise errors caught by the controller.
-class SettingsController; def rescue_action(e) raise e end; end
class SettingsControllerTest < ActionController::TestCase
fixtures :users
def setup
- @controller = SettingsController.new
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
User.current = nil
@request.session[:user_id] = 1 # admin
end
diff --git a/test/functional/sys_controller_test.rb b/test/functional/sys_controller_test.rb
index d046c231a..0f9a74609 100644
--- a/test/functional/sys_controller_test.rb
+++ b/test/functional/sys_controller_test.rb
@@ -16,19 +16,11 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require File.expand_path('../../test_helper', __FILE__)
-require 'sys_controller'
-require 'mocha'
-
-# Re-raise errors caught by the controller.
-class SysController; def rescue_action(e) raise e end; end
class SysControllerTest < ActionController::TestCase
fixtures :projects, :repositories, :enabled_modules
def setup
- @controller = SysController.new
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
Setting.sys_api_enabled = '1'
Setting.enabled_scm = %w(Subversion Git)
end
diff --git a/test/functional/time_entry_reports_controller_test.rb b/test/functional/time_entry_reports_controller_test.rb
index 9803160f5..05c42d527 100644
--- a/test/functional/time_entry_reports_controller_test.rb
+++ b/test/functional/time_entry_reports_controller_test.rb
@@ -1,4 +1,21 @@
# -*- coding: utf-8 -*-
+# Redmine - project management software
+# Copyright (C) 2006-2012 Jean-Philippe Lang
+#
+# 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 the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
require File.expand_path('../../test_helper', __FILE__)
class TimeEntryReportsControllerTest < ActionController::TestCase
diff --git a/test/functional/timelog_controller_test.rb b/test/functional/timelog_controller_test.rb
index 2bc22a7ee..040d9c647 100644
--- a/test/functional/timelog_controller_test.rb
+++ b/test/functional/timelog_controller_test.rb
@@ -17,10 +17,6 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require File.expand_path('../../test_helper', __FILE__)
-require 'timelog_controller'
-
-# Re-raise errors caught by the controller.
-class TimelogController; def rescue_action(e) raise e end; end
class TimelogControllerTest < ActionController::TestCase
fixtures :projects, :enabled_modules, :roles, :members,
@@ -30,12 +26,6 @@ class TimelogControllerTest < ActionController::TestCase
include Redmine::I18n
- def setup
- @controller = TimelogController.new
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
- end
-
def test_new_with_project_id
@request.session[:user_id] = 3
get :new, :project_id => 1
diff --git a/test/functional/trackers_controller_test.rb b/test/functional/trackers_controller_test.rb
index 9a8ec54b0..b5f4d72bb 100644
--- a/test/functional/trackers_controller_test.rb
+++ b/test/functional/trackers_controller_test.rb
@@ -16,18 +16,11 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require File.expand_path('../../test_helper', __FILE__)
-require 'trackers_controller'
-
-# Re-raise errors caught by the controller.
-class TrackersController; def rescue_action(e) raise e end; end
class TrackersControllerTest < ActionController::TestCase
fixtures :trackers, :projects, :projects_trackers, :users, :issues, :custom_fields
def setup
- @controller = TrackersController.new
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
User.current = nil
@request.session[:user_id] = 1 # admin
end
diff --git a/test/functional/users_controller_test.rb b/test/functional/users_controller_test.rb
index 6ff9b72ab..7208d912a 100644
--- a/test/functional/users_controller_test.rb
+++ b/test/functional/users_controller_test.rb
@@ -16,10 +16,6 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require File.expand_path('../../test_helper', __FILE__)
-require 'users_controller'
-
-# Re-raise errors caught by the controller.
-class UsersController; def rescue_action(e) raise e end; end
class UsersControllerTest < ActionController::TestCase
include Redmine::I18n
@@ -29,9 +25,6 @@ class UsersControllerTest < ActionController::TestCase
:auth_sources
def setup
- @controller = UsersController.new
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
User.current = nil
@request.session[:user_id] = 1 # admin
end
diff --git a/test/functional/versions_controller_test.rb b/test/functional/versions_controller_test.rb
index 8379585d5..c5700efdd 100644
--- a/test/functional/versions_controller_test.rb
+++ b/test/functional/versions_controller_test.rb
@@ -16,18 +16,11 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require File.expand_path('../../test_helper', __FILE__)
-require 'versions_controller'
-
-# Re-raise errors caught by the controller.
-class VersionsController; def rescue_action(e) raise e end; end
class VersionsControllerTest < ActionController::TestCase
fixtures :projects, :versions, :issues, :users, :roles, :members, :member_roles, :enabled_modules, :issue_statuses, :issue_categories
def setup
- @controller = VersionsController.new
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
User.current = nil
end
diff --git a/test/functional/watchers_controller_test.rb b/test/functional/watchers_controller_test.rb
index 6bf6e25b2..2e24be30a 100644
--- a/test/functional/watchers_controller_test.rb
+++ b/test/functional/watchers_controller_test.rb
@@ -16,19 +16,12 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require File.expand_path('../../test_helper', __FILE__)
-require 'watchers_controller'
-
-# Re-raise errors caught by the controller.
-class WatchersController; def rescue_action(e) raise e end; end
class WatchersControllerTest < ActionController::TestCase
fixtures :projects, :users, :roles, :members, :member_roles, :enabled_modules,
:issues, :trackers, :projects_trackers, :issue_statuses, :enumerations, :watchers
def setup
- @controller = WatchersController.new
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
User.current = nil
end
diff --git a/test/functional/welcome_controller_test.rb b/test/functional/welcome_controller_test.rb
index 5502773a4..11e6cffdd 100644
--- a/test/functional/welcome_controller_test.rb
+++ b/test/functional/welcome_controller_test.rb
@@ -16,18 +16,11 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require File.expand_path('../../test_helper', __FILE__)
-require 'welcome_controller'
-
-# Re-raise errors caught by the controller.
-class WelcomeController; def rescue_action(e) raise e end; end
class WelcomeControllerTest < ActionController::TestCase
fixtures :projects, :news, :users, :members
def setup
- @controller = WelcomeController.new
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
User.current = nil
end
diff --git a/test/functional/wiki_controller_test.rb b/test/functional/wiki_controller_test.rb
index 3673c7622..05f4eb3af 100644
--- a/test/functional/wiki_controller_test.rb
+++ b/test/functional/wiki_controller_test.rb
@@ -16,10 +16,6 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require File.expand_path('../../test_helper', __FILE__)
-require 'wiki_controller'
-
-# Re-raise errors caught by the controller.
-class WikiController; def rescue_action(e) raise e end; end
class WikiControllerTest < ActionController::TestCase
fixtures :projects, :users, :roles, :members, :member_roles,
@@ -27,9 +23,6 @@ class WikiControllerTest < ActionController::TestCase
:wiki_content_versions, :attachments
def setup
- @controller = WikiController.new
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
User.current = nil
end
diff --git a/test/functional/wikis_controller_test.rb b/test/functional/wikis_controller_test.rb
index d795ef1c0..b287e1c4f 100644
--- a/test/functional/wikis_controller_test.rb
+++ b/test/functional/wikis_controller_test.rb
@@ -16,18 +16,11 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require File.expand_path('../../test_helper', __FILE__)
-require 'wikis_controller'
-
-# Re-raise errors caught by the controller.
-class WikisController; def rescue_action(e) raise e end; end
class WikisControllerTest < ActionController::TestCase
fixtures :projects, :users, :roles, :members, :member_roles, :enabled_modules, :wikis
def setup
- @controller = WikisController.new
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
User.current = nil
end
diff --git a/test/functional/workflows_controller_test.rb b/test/functional/workflows_controller_test.rb
index 97387489b..c4170ff52 100644
--- a/test/functional/workflows_controller_test.rb
+++ b/test/functional/workflows_controller_test.rb
@@ -16,18 +16,11 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require File.expand_path('../../test_helper', __FILE__)
-require 'workflows_controller'
-
-# Re-raise errors caught by the controller.
-class WorkflowsController; def rescue_action(e) raise e end; end
class WorkflowsControllerTest < ActionController::TestCase
fixtures :roles, :trackers, :workflows, :users, :issue_statuses
def setup
- @controller = WorkflowsController.new
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
User.current = nil
@request.session[:user_id] = 1 # admin
end