]> source.dussan.org Git - redmine.git/commitdiff
Functional tests cleanup.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 3 Dec 2012 22:23:23 +0000 (22:23 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 3 Dec 2012 22:23:23 +0000 (22:23 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10936 e93f8b46-1217-0410-a6f0-8f06a7374b81

35 files changed:
test/functional/account_controller_test.rb
test/functional/activities_controller_test.rb
test/functional/attachments_controller_test.rb
test/functional/auto_completes_controller_test.rb
test/functional/calendars_controller_test.rb
test/functional/context_menus_controller_test.rb
test/functional/files_controller_test.rb
test/functional/gantts_controller_test.rb
test/functional/issue_categories_controller_test.rb
test/functional/issue_statuses_controller_test.rb
test/functional/issues_controller_test.rb
test/functional/issues_controller_transaction_test.rb
test/functional/journals_controller_test.rb
test/functional/mail_handler_controller_test.rb
test/functional/members_controller_test.rb
test/functional/messages_controller_test.rb
test/functional/news_controller_test.rb
test/functional/project_enumerations_controller_test.rb
test/functional/projects_controller_test.rb
test/functional/reports_controller_test.rb
test/functional/repositories_controller_test.rb
test/functional/roles_controller_test.rb
test/functional/search_controller_test.rb
test/functional/settings_controller_test.rb
test/functional/sys_controller_test.rb
test/functional/time_entry_reports_controller_test.rb
test/functional/timelog_controller_test.rb
test/functional/trackers_controller_test.rb
test/functional/users_controller_test.rb
test/functional/versions_controller_test.rb
test/functional/watchers_controller_test.rb
test/functional/welcome_controller_test.rb
test/functional/wiki_controller_test.rb
test/functional/wikis_controller_test.rb
test/functional/workflows_controller_test.rb

index c715fa80dd0bda5a8f0e38cd679440a410d21f65..08960b451300768ffc95c33f6ab3303aaddc9649 100644 (file)
 # 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
 
index 234ea7c57aa00f731568498bdbf0edd2070fb94b..b5effcd30a34eaa13a2c2985155fb79c950b2944 100644 (file)
@@ -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
index 8c0375d6d0652afb541be66c7091ce82721df0b1..ac66a64548cd0956c63bfcc5183a5e0e8818e2ec 100644 (file)
 # 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
index 0be93b049e8c6cf6b98ff2bea55b4d7e21a45450..099cf64efd718b58c1aa2b8920979f65d0e89369 100644 (file)
@@ -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
index b1402dfb39672c7f3f1446d5bd4f032f6b142775..2855afbbf1b81d5d3fbdc523b760b6962bc4c660 100644 (file)
@@ -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
index 55feeca4349fcdd4c7b260270a7f4fe0a3255d8f..dc8406b797bfd339431f621f620b425beb3c11cc 100644 (file)
@@ -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
index 8691a18180880efca979bba8de79b34bd22cee9b..045fa775644efaee991a1af691b67e59aeec5a07 100644 (file)
@@ -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
index 98dca862ba3e3da74591a2837dafff199a193b09..902eaff26ac82a54f1d49f8d2c73e7e35f1c6c56 100644 (file)
@@ -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
index 6f45cf1a69c1da1755b31cc7eaea06e5226b4b8e..db90e7d1064f15c39d3f45dd3268f93cf6b07ce7 100644 (file)
 # 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
index 1662413e0c5b502424a875b8227ec73aa69bcee7..0194be22e8b7269475a32114cc6eafd1778eaf9b 100644 (file)
@@ -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
index 03e2b52c5d2445fe5c842e6fda9b236211a96eab..7efaa22e5e0e1c0ec44502b907dca7e39e4a3469 100644 (file)
@@ -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
 
index 20a3895ff6fe7ea4053d79d341d21cc4442e4c7e..85c573f9d8857ebf4912711b6263ac98fe9916ab 100644 (file)
@@ -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
 
index 5ba4725eb79673329f9f21b35ba74fb4bf098ceb..110774d8a27567517247c57cc0c04b674d64474c 100644 (file)
 # 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
 
index b90b44b2ecfa548f18816ce29e2f75f077304522..efd696c328c5705821f0250aa82c8a535fc50835 100644 (file)
 # 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
 
index 55bbad5cee6ca57e4c0b1bb28374c8b6d1381635..cb9d45f8cb15e4aca9c4a399223b98f086bf1cda 100644 (file)
 # 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
index 0276928e2d81422debe8e3dbc6d29fcc0adb41ec..fa3af791742f15a735740e63fead2d5e6955ec14 100644 (file)
 # 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
 
index 4bc1a2a37ee26227cb0c473a4f26533f179c4d08..6d44bb1e7d31ba63a0d564e77782870e2e3fdfca 100644 (file)
 # 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
 
index a50f7968f4cf82ee23146a50068d5e0a7f41a95f..352f54251aadd9b29ac863067f0e3fe0c71df80f 100644 (file)
@@ -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
index b606f4802edc31ecadf39bb73e5af280a9873528..ac9312ca88c7db1cb3f2279dcf2a8ac3c156284c 100644 (file)
 # 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
index c44a8a229a455634feb78f17e242c5c7bf5cb071..9dcbd8ff2380820afdec67bd321fa9a4d9371187 100644 (file)
@@ -28,9 +28,6 @@ class ReportsControllerTest < ActionController::TestCase
            :workflows,
            :versions
 
-  def setup
-  end
-
   def test_get_issue_report
     get :issue_report, :id => 1
 
index 3304127e1f08bef4931b0cc424748ec12d8aa627..61e0a0d406f2620ba2a2f4ec5b26e374baea0b22 100644 (file)
 # 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
 
index 68c573ac608d4d32b1d99687a954c00e4c550040..a2af70acdae5035c490d4c3db190ce288664bae2 100644 (file)
@@ -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
index 40e140060c6f46b31cbc5c3a67d0af8276f51f4b..eb5f34a6ad9be687b54d6a42969b2f3e289c058c 100644 (file)
@@ -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
 
index 034b902d03f5718790a3d2c981113b3b15e2805f..94f199f1b4af8a5fbd1b740f94d386a244319a3c 100644 (file)
 # 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
index d046c231a33ba1100b3b685bf456d6619251df36..0f9a746094ec4dc85b6566141de14a87c171f8a5 100644 (file)
 # 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
index 9803160f559f9a83ddc29102eee673c37c8dfb1f..05c42d52782aa4e08a9deb059eed1ff5e0afdc42 100644 (file)
@@ -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
index 2bc22a7eeac3443833ac7293d44abe9ede603595..040d9c647f9be648fc774415d4153596f18e7c36 100644 (file)
 # 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
index 9a8ec54b0aebcfdcd0a27a709508681f65124432..b5f4d72bb91c10934562989d44135e052035a604 100644 (file)
 # 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
index 6ff9b72ab0c08817bd48803f09320232ee304b89..7208d912ad8a371ee56295cdf808f5e973e90106 100644 (file)
 # 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
index 8379585d5eb58fdb27199119144a623734f2a0df..c5700efddd394f24c2181d875ee0864aeb20de00 100644 (file)
 # 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
 
index 6bf6e25b2cd09b526b01d83a20258f89f62e6ea5..2e24be30adfd8f723feff80629a3c4a4375fad67 100644 (file)
 # 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
 
index 5502773a48f8e710c1ce3b112e7fd60b207f1e8b..11e6cffdd8d4279c57fa0f5f9a2644627ef04655 100644 (file)
 # 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
 
index 3673c7622833df126efaaff5d23070e3d6eff0ad..05f4eb3afda15ec2eb14e25811d76d806ac7d875 100644 (file)
 # 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
 
index d795ef1c0bb0bcfe3609fb947788a1038905aaa5..b287e1c4fa46adb365f3e80d62313299c07ba215 100644 (file)
 # 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
 
index 97387489b2cccd7e80727e255b6e929ab432d06d..c4170ff528a718892086151ae5addaac8b37bdb5 100644 (file)
 # 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