Functional tests cleanup.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10936 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
349049a539
commit
4cc4e8bfd3
|
@ -16,18 +16,11 @@
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
require File.expand_path('../../test_helper', __FILE__)
|
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
|
class AccountControllerTest < ActionController::TestCase
|
||||||
fixtures :users, :roles
|
fixtures :users, :roles
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
@controller = AccountController.new
|
|
||||||
@request = ActionController::TestRequest.new
|
|
||||||
@response = ActionController::TestResponse.new
|
|
||||||
User.current = nil
|
User.current = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -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__)
|
require File.expand_path('../../test_helper', __FILE__)
|
||||||
|
|
||||||
class ActivitiesControllerTest < ActionController::TestCase
|
class ActivitiesControllerTest < ActionController::TestCase
|
||||||
|
|
|
@ -18,10 +18,6 @@
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
require File.expand_path('../../test_helper', __FILE__)
|
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
|
class AttachmentsControllerTest < ActionController::TestCase
|
||||||
fixtures :users, :projects, :roles, :members, :member_roles,
|
fixtures :users, :projects, :roles, :members, :member_roles,
|
||||||
|
@ -29,9 +25,6 @@ class AttachmentsControllerTest < ActionController::TestCase
|
||||||
:versions, :wiki_pages, :wikis, :documents
|
:versions, :wiki_pages, :wikis, :documents
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
@controller = AttachmentsController.new
|
|
||||||
@request = ActionController::TestRequest.new
|
|
||||||
@response = ActionController::TestResponse.new
|
|
||||||
User.current = nil
|
User.current = nil
|
||||||
set_fixtures_attachments_directory
|
set_fixtures_attachments_directory
|
||||||
end
|
end
|
||||||
|
|
|
@ -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__)
|
require File.expand_path('../../test_helper', __FILE__)
|
||||||
|
|
||||||
class AutoCompletesControllerTest < ActionController::TestCase
|
class AutoCompletesControllerTest < ActionController::TestCase
|
||||||
|
|
|
@ -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__)
|
require File.expand_path('../../test_helper', __FILE__)
|
||||||
|
|
||||||
class CalendarsControllerTest < ActionController::TestCase
|
class CalendarsControllerTest < ActionController::TestCase
|
||||||
|
|
|
@ -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__)
|
require File.expand_path('../../test_helper', __FILE__)
|
||||||
|
|
||||||
class ContextMenusControllerTest < ActionController::TestCase
|
class ContextMenusControllerTest < ActionController::TestCase
|
||||||
|
|
|
@ -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__)
|
require File.expand_path('../../test_helper', __FILE__)
|
||||||
|
|
||||||
class FilesControllerTest < ActionController::TestCase
|
class FilesControllerTest < ActionController::TestCase
|
||||||
|
@ -14,9 +31,6 @@ class FilesControllerTest < ActionController::TestCase
|
||||||
:versions
|
:versions
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
@controller = FilesController.new
|
|
||||||
@request = ActionController::TestRequest.new
|
|
||||||
@response = ActionController::TestResponse.new
|
|
||||||
@request.session[:user_id] = nil
|
@request.session[:user_id] = nil
|
||||||
Setting.default_language = 'en'
|
Setting.default_language = 'en'
|
||||||
end
|
end
|
||||||
|
|
|
@ -28,80 +28,80 @@ class GanttsControllerTest < ActionController::TestCase
|
||||||
:workflows,
|
:workflows,
|
||||||
:versions
|
:versions
|
||||||
|
|
||||||
def test_gantt_should_work
|
def test_gantt_should_work
|
||||||
i2 = Issue.find(2)
|
i2 = Issue.find(2)
|
||||||
i2.update_attribute(:due_date, 1.month.from_now)
|
i2.update_attribute(:due_date, 1.month.from_now)
|
||||||
get :show, :project_id => 1
|
get :show, :project_id => 1
|
||||||
assert_response :success
|
assert_response :success
|
||||||
assert_template 'gantts/show'
|
assert_template 'gantts/show'
|
||||||
assert_not_nil assigns(:gantt)
|
assert_not_nil assigns(:gantt)
|
||||||
# Issue with start and due dates
|
# Issue with start and due dates
|
||||||
i = Issue.find(1)
|
i = Issue.find(1)
|
||||||
assert_not_nil i.due_date
|
assert_not_nil i.due_date
|
||||||
assert_select "div a.issue", /##{i.id}/
|
assert_select "div a.issue", /##{i.id}/
|
||||||
# Issue with on a targeted version should not be in the events but loaded in the html
|
# Issue with on a targeted version should not be in the events but loaded in the html
|
||||||
i = Issue.find(2)
|
i = Issue.find(2)
|
||||||
assert_select "div a.issue", /##{i.id}/
|
assert_select "div a.issue", /##{i.id}/
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_gantt_should_work_without_issue_due_dates
|
def test_gantt_should_work_without_issue_due_dates
|
||||||
Issue.update_all("due_date = NULL")
|
Issue.update_all("due_date = NULL")
|
||||||
get :show, :project_id => 1
|
get :show, :project_id => 1
|
||||||
assert_response :success
|
assert_response :success
|
||||||
assert_template 'gantts/show'
|
assert_template 'gantts/show'
|
||||||
assert_not_nil assigns(:gantt)
|
assert_not_nil assigns(:gantt)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_gantt_should_work_without_issue_and_version_due_dates
|
def test_gantt_should_work_without_issue_and_version_due_dates
|
||||||
Issue.update_all("due_date = NULL")
|
Issue.update_all("due_date = NULL")
|
||||||
Version.update_all("effective_date = NULL")
|
Version.update_all("effective_date = NULL")
|
||||||
get :show, :project_id => 1
|
get :show, :project_id => 1
|
||||||
assert_response :success
|
assert_response :success
|
||||||
assert_template 'gantts/show'
|
assert_template 'gantts/show'
|
||||||
assert_not_nil assigns(:gantt)
|
assert_not_nil assigns(:gantt)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_gantt_should_work_cross_project
|
def test_gantt_should_work_cross_project
|
||||||
get :show
|
get :show
|
||||||
assert_response :success
|
assert_response :success
|
||||||
assert_template 'gantts/show'
|
assert_template 'gantts/show'
|
||||||
assert_not_nil assigns(:gantt)
|
assert_not_nil assigns(:gantt)
|
||||||
assert_not_nil assigns(:gantt).query
|
assert_not_nil assigns(:gantt).query
|
||||||
assert_nil assigns(:gantt).project
|
assert_nil assigns(:gantt).project
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_gantt_should_not_disclose_private_projects
|
def test_gantt_should_not_disclose_private_projects
|
||||||
get :show
|
get :show
|
||||||
assert_response :success
|
assert_response :success
|
||||||
assert_template 'gantts/show'
|
assert_template 'gantts/show'
|
||||||
assert_tag 'a', :content => /eCookbook/
|
assert_tag 'a', :content => /eCookbook/
|
||||||
# Root private project
|
# Root private project
|
||||||
assert_no_tag 'a', {:content => /OnlineStore/}
|
assert_no_tag 'a', {:content => /OnlineStore/}
|
||||||
# Private children of a public project
|
# Private children of a public project
|
||||||
assert_no_tag 'a', :content => /Private child of eCookbook/
|
assert_no_tag 'a', :content => /Private child of eCookbook/
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_gantt_should_export_to_pdf
|
def test_gantt_should_export_to_pdf
|
||||||
get :show, :project_id => 1, :format => 'pdf'
|
get :show, :project_id => 1, :format => 'pdf'
|
||||||
assert_response :success
|
assert_response :success
|
||||||
assert_equal 'application/pdf', @response.content_type
|
assert_equal 'application/pdf', @response.content_type
|
||||||
assert @response.body.starts_with?('%PDF')
|
assert @response.body.starts_with?('%PDF')
|
||||||
assert_not_nil assigns(:gantt)
|
assert_not_nil assigns(:gantt)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_gantt_should_export_to_pdf_cross_project
|
def test_gantt_should_export_to_pdf_cross_project
|
||||||
get :show, :format => 'pdf'
|
get :show, :format => 'pdf'
|
||||||
assert_response :success
|
assert_response :success
|
||||||
assert_equal 'application/pdf', @response.content_type
|
assert_equal 'application/pdf', @response.content_type
|
||||||
assert @response.body.starts_with?('%PDF')
|
assert @response.body.starts_with?('%PDF')
|
||||||
assert_not_nil assigns(:gantt)
|
assert_not_nil assigns(:gantt)
|
||||||
end
|
end
|
||||||
|
|
||||||
if Object.const_defined?(:Magick)
|
if Object.const_defined?(:Magick)
|
||||||
def test_gantt_should_export_to_png
|
def test_gantt_should_export_to_png
|
||||||
get :show, :project_id => 1, :format => 'png'
|
get :show, :project_id => 1, :format => 'png'
|
||||||
assert_response :success
|
assert_response :success
|
||||||
assert_equal 'image/png', @response.content_type
|
assert_equal 'image/png', @response.content_type
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -16,19 +16,12 @@
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
require File.expand_path('../../test_helper', __FILE__)
|
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
|
class IssueCategoriesControllerTest < ActionController::TestCase
|
||||||
fixtures :projects, :users, :members, :member_roles, :roles, :enabled_modules, :issue_categories,
|
fixtures :projects, :users, :members, :member_roles, :roles, :enabled_modules, :issue_categories,
|
||||||
:issues
|
:issues
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
@controller = IssueCategoriesController.new
|
|
||||||
@request = ActionController::TestRequest.new
|
|
||||||
@response = ActionController::TestResponse.new
|
|
||||||
User.current = nil
|
User.current = nil
|
||||||
@request.session[:user_id] = 2
|
@request.session[:user_id] = 2
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,17 +1,26 @@
|
||||||
|
# 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__)
|
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
|
|
||||||
|
|
||||||
|
|
||||||
class IssueStatusesControllerTest < ActionController::TestCase
|
class IssueStatusesControllerTest < ActionController::TestCase
|
||||||
fixtures :issue_statuses, :issues, :users
|
fixtures :issue_statuses, :issues, :users
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
@controller = IssueStatusesController.new
|
|
||||||
@request = ActionController::TestRequest.new
|
|
||||||
@response = ActionController::TestResponse.new
|
|
||||||
User.current = nil
|
User.current = nil
|
||||||
@request.session[:user_id] = 1 # admin
|
@request.session[:user_id] = 1 # admin
|
||||||
end
|
end
|
||||||
|
|
|
@ -16,7 +16,6 @@
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
require File.expand_path('../../test_helper', __FILE__)
|
require File.expand_path('../../test_helper', __FILE__)
|
||||||
require 'issues_controller'
|
|
||||||
|
|
||||||
class IssuesControllerTest < ActionController::TestCase
|
class IssuesControllerTest < ActionController::TestCase
|
||||||
fixtures :projects,
|
fixtures :projects,
|
||||||
|
@ -48,9 +47,6 @@ class IssuesControllerTest < ActionController::TestCase
|
||||||
include Redmine::I18n
|
include Redmine::I18n
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
@controller = IssuesController.new
|
|
||||||
@request = ActionController::TestRequest.new
|
|
||||||
@response = ActionController::TestResponse.new
|
|
||||||
User.current = nil
|
User.current = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@ require File.expand_path('../../test_helper', __FILE__)
|
||||||
require 'issues_controller'
|
require 'issues_controller'
|
||||||
|
|
||||||
class IssuesControllerTransactionTest < ActionController::TestCase
|
class IssuesControllerTransactionTest < ActionController::TestCase
|
||||||
|
tests IssuesController
|
||||||
fixtures :projects,
|
fixtures :projects,
|
||||||
:users,
|
:users,
|
||||||
:roles,
|
:roles,
|
||||||
|
@ -46,9 +47,6 @@ class IssuesControllerTransactionTest < ActionController::TestCase
|
||||||
self.use_transactional_fixtures = false
|
self.use_transactional_fixtures = false
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
@controller = IssuesController.new
|
|
||||||
@request = ActionController::TestRequest.new
|
|
||||||
@response = ActionController::TestResponse.new
|
|
||||||
User.current = nil
|
User.current = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -16,19 +16,12 @@
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
require File.expand_path('../../test_helper', __FILE__)
|
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
|
class JournalsControllerTest < ActionController::TestCase
|
||||||
fixtures :projects, :users, :members, :member_roles, :roles, :issues, :journals, :journal_details, :enabled_modules,
|
fixtures :projects, :users, :members, :member_roles, :roles, :issues, :journals, :journal_details, :enabled_modules,
|
||||||
:trackers, :issue_statuses, :enumerations, :custom_fields, :custom_values, :custom_fields_projects
|
:trackers, :issue_statuses, :enumerations, :custom_fields, :custom_values, :custom_fields_projects
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
@controller = JournalsController.new
|
|
||||||
@request = ActionController::TestRequest.new
|
|
||||||
@response = ActionController::TestResponse.new
|
|
||||||
User.current = nil
|
User.current = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -16,10 +16,6 @@
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
require File.expand_path('../../test_helper', __FILE__)
|
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
|
class MailHandlerControllerTest < ActionController::TestCase
|
||||||
fixtures :users, :projects, :enabled_modules, :roles, :members, :member_roles, :issues, :issue_statuses,
|
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'
|
FIXTURES_PATH = File.dirname(__FILE__) + '/../fixtures/mail_handler'
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
@controller = MailHandlerController.new
|
|
||||||
@request = ActionController::TestRequest.new
|
|
||||||
@response = ActionController::TestResponse.new
|
|
||||||
User.current = nil
|
User.current = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -16,19 +16,11 @@
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
require File.expand_path('../../test_helper', __FILE__)
|
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
|
class MembersControllerTest < ActionController::TestCase
|
||||||
fixtures :projects, :members, :member_roles, :roles, :users
|
fixtures :projects, :members, :member_roles, :roles, :users
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
@controller = MembersController.new
|
|
||||||
@request = ActionController::TestRequest.new
|
|
||||||
@response = ActionController::TestResponse.new
|
|
||||||
User.current = nil
|
User.current = nil
|
||||||
@request.session[:user_id] = 2
|
@request.session[:user_id] = 2
|
||||||
end
|
end
|
||||||
|
|
|
@ -16,18 +16,11 @@
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
require File.expand_path('../../test_helper', __FILE__)
|
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
|
class MessagesControllerTest < ActionController::TestCase
|
||||||
fixtures :projects, :users, :members, :member_roles, :roles, :boards, :messages, :enabled_modules
|
fixtures :projects, :users, :members, :member_roles, :roles, :boards, :messages, :enabled_modules
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
@controller = MessagesController.new
|
|
||||||
@request = ActionController::TestRequest.new
|
|
||||||
@response = ActionController::TestResponse.new
|
|
||||||
User.current = nil
|
User.current = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -16,18 +16,11 @@
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
require File.expand_path('../../test_helper', __FILE__)
|
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
|
class NewsControllerTest < ActionController::TestCase
|
||||||
fixtures :projects, :users, :roles, :members, :member_roles, :enabled_modules, :news, :comments
|
fixtures :projects, :users, :roles, :members, :member_roles, :enabled_modules, :news, :comments
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
@controller = NewsController.new
|
|
||||||
@request = ActionController::TestRequest.new
|
|
||||||
@response = ActionController::TestResponse.new
|
|
||||||
User.current = nil
|
User.current = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -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__)
|
require File.expand_path('../../test_helper', __FILE__)
|
||||||
|
|
||||||
class ProjectEnumerationsControllerTest < ActionController::TestCase
|
class ProjectEnumerationsControllerTest < ActionController::TestCase
|
||||||
|
|
|
@ -16,10 +16,6 @@
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
require File.expand_path('../../test_helper', __FILE__)
|
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
|
class ProjectsControllerTest < ActionController::TestCase
|
||||||
fixtures :projects, :versions, :users, :roles, :members, :member_roles, :issues, :journals, :journal_details,
|
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
|
:attachments, :custom_fields, :custom_values, :time_entries
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
@controller = ProjectsController.new
|
|
||||||
@request = ActionController::TestRequest.new
|
|
||||||
@response = ActionController::TestResponse.new
|
|
||||||
@request.session[:user_id] = nil
|
@request.session[:user_id] = nil
|
||||||
Setting.default_language = 'en'
|
Setting.default_language = 'en'
|
||||||
end
|
end
|
||||||
|
|
|
@ -28,9 +28,6 @@ class ReportsControllerTest < ActionController::TestCase
|
||||||
:workflows,
|
:workflows,
|
||||||
:versions
|
:versions
|
||||||
|
|
||||||
def setup
|
|
||||||
end
|
|
||||||
|
|
||||||
def test_get_issue_report
|
def test_get_issue_report
|
||||||
get :issue_report, :id => 1
|
get :issue_report, :id => 1
|
||||||
|
|
||||||
|
|
|
@ -16,10 +16,6 @@
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
require File.expand_path('../../test_helper', __FILE__)
|
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
|
class RepositoriesControllerTest < ActionController::TestCase
|
||||||
fixtures :projects, :users, :roles, :members, :member_roles, :enabled_modules,
|
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
|
:issue_categories, :enumerations, :custom_fields, :custom_values, :trackers
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
@controller = RepositoriesController.new
|
|
||||||
@request = ActionController::TestRequest.new
|
|
||||||
@response = ActionController::TestResponse.new
|
|
||||||
User.current = nil
|
User.current = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -21,9 +21,6 @@ class RolesControllerTest < ActionController::TestCase
|
||||||
fixtures :roles, :users, :members, :member_roles, :workflows, :trackers
|
fixtures :roles, :users, :members, :member_roles, :workflows, :trackers
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
@controller = RolesController.new
|
|
||||||
@request = ActionController::TestRequest.new
|
|
||||||
@response = ActionController::TestResponse.new
|
|
||||||
User.current = nil
|
User.current = nil
|
||||||
@request.session[:user_id] = 1 # admin
|
@request.session[:user_id] = 1 # admin
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,8 +1,21 @@
|
||||||
require File.expand_path('../../test_helper', __FILE__)
|
# Redmine - project management software
|
||||||
require 'search_controller'
|
# 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.
|
require File.expand_path('../../test_helper', __FILE__)
|
||||||
class SearchController; def rescue_action(e) raise e end; end
|
|
||||||
|
|
||||||
class SearchControllerTest < ActionController::TestCase
|
class SearchControllerTest < ActionController::TestCase
|
||||||
fixtures :projects, :enabled_modules, :roles, :users, :members, :member_roles,
|
fixtures :projects, :enabled_modules, :roles, :users, :members, :member_roles,
|
||||||
|
@ -11,9 +24,6 @@ class SearchControllerTest < ActionController::TestCase
|
||||||
:repositories, :changesets
|
:repositories, :changesets
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
@controller = SearchController.new
|
|
||||||
@request = ActionController::TestRequest.new
|
|
||||||
@response = ActionController::TestResponse.new
|
|
||||||
User.current = nil
|
User.current = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -16,18 +16,11 @@
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
require File.expand_path('../../test_helper', __FILE__)
|
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
|
class SettingsControllerTest < ActionController::TestCase
|
||||||
fixtures :users
|
fixtures :users
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
@controller = SettingsController.new
|
|
||||||
@request = ActionController::TestRequest.new
|
|
||||||
@response = ActionController::TestResponse.new
|
|
||||||
User.current = nil
|
User.current = nil
|
||||||
@request.session[:user_id] = 1 # admin
|
@request.session[:user_id] = 1 # admin
|
||||||
end
|
end
|
||||||
|
|
|
@ -16,19 +16,11 @@
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
require File.expand_path('../../test_helper', __FILE__)
|
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
|
class SysControllerTest < ActionController::TestCase
|
||||||
fixtures :projects, :repositories, :enabled_modules
|
fixtures :projects, :repositories, :enabled_modules
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
@controller = SysController.new
|
|
||||||
@request = ActionController::TestRequest.new
|
|
||||||
@response = ActionController::TestResponse.new
|
|
||||||
Setting.sys_api_enabled = '1'
|
Setting.sys_api_enabled = '1'
|
||||||
Setting.enabled_scm = %w(Subversion Git)
|
Setting.enabled_scm = %w(Subversion Git)
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,21 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- 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__)
|
require File.expand_path('../../test_helper', __FILE__)
|
||||||
|
|
||||||
class TimeEntryReportsControllerTest < ActionController::TestCase
|
class TimeEntryReportsControllerTest < ActionController::TestCase
|
||||||
|
|
|
@ -17,10 +17,6 @@
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
require File.expand_path('../../test_helper', __FILE__)
|
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
|
class TimelogControllerTest < ActionController::TestCase
|
||||||
fixtures :projects, :enabled_modules, :roles, :members,
|
fixtures :projects, :enabled_modules, :roles, :members,
|
||||||
|
@ -30,12 +26,6 @@ class TimelogControllerTest < ActionController::TestCase
|
||||||
|
|
||||||
include Redmine::I18n
|
include Redmine::I18n
|
||||||
|
|
||||||
def setup
|
|
||||||
@controller = TimelogController.new
|
|
||||||
@request = ActionController::TestRequest.new
|
|
||||||
@response = ActionController::TestResponse.new
|
|
||||||
end
|
|
||||||
|
|
||||||
def test_new_with_project_id
|
def test_new_with_project_id
|
||||||
@request.session[:user_id] = 3
|
@request.session[:user_id] = 3
|
||||||
get :new, :project_id => 1
|
get :new, :project_id => 1
|
||||||
|
|
|
@ -16,18 +16,11 @@
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
require File.expand_path('../../test_helper', __FILE__)
|
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
|
class TrackersControllerTest < ActionController::TestCase
|
||||||
fixtures :trackers, :projects, :projects_trackers, :users, :issues, :custom_fields
|
fixtures :trackers, :projects, :projects_trackers, :users, :issues, :custom_fields
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
@controller = TrackersController.new
|
|
||||||
@request = ActionController::TestRequest.new
|
|
||||||
@response = ActionController::TestResponse.new
|
|
||||||
User.current = nil
|
User.current = nil
|
||||||
@request.session[:user_id] = 1 # admin
|
@request.session[:user_id] = 1 # admin
|
||||||
end
|
end
|
||||||
|
|
|
@ -16,10 +16,6 @@
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
require File.expand_path('../../test_helper', __FILE__)
|
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
|
class UsersControllerTest < ActionController::TestCase
|
||||||
include Redmine::I18n
|
include Redmine::I18n
|
||||||
|
@ -29,9 +25,6 @@ class UsersControllerTest < ActionController::TestCase
|
||||||
:auth_sources
|
:auth_sources
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
@controller = UsersController.new
|
|
||||||
@request = ActionController::TestRequest.new
|
|
||||||
@response = ActionController::TestResponse.new
|
|
||||||
User.current = nil
|
User.current = nil
|
||||||
@request.session[:user_id] = 1 # admin
|
@request.session[:user_id] = 1 # admin
|
||||||
end
|
end
|
||||||
|
|
|
@ -16,18 +16,11 @@
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
require File.expand_path('../../test_helper', __FILE__)
|
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
|
class VersionsControllerTest < ActionController::TestCase
|
||||||
fixtures :projects, :versions, :issues, :users, :roles, :members, :member_roles, :enabled_modules, :issue_statuses, :issue_categories
|
fixtures :projects, :versions, :issues, :users, :roles, :members, :member_roles, :enabled_modules, :issue_statuses, :issue_categories
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
@controller = VersionsController.new
|
|
||||||
@request = ActionController::TestRequest.new
|
|
||||||
@response = ActionController::TestResponse.new
|
|
||||||
User.current = nil
|
User.current = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -16,19 +16,12 @@
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
require File.expand_path('../../test_helper', __FILE__)
|
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
|
class WatchersControllerTest < ActionController::TestCase
|
||||||
fixtures :projects, :users, :roles, :members, :member_roles, :enabled_modules,
|
fixtures :projects, :users, :roles, :members, :member_roles, :enabled_modules,
|
||||||
:issues, :trackers, :projects_trackers, :issue_statuses, :enumerations, :watchers
|
:issues, :trackers, :projects_trackers, :issue_statuses, :enumerations, :watchers
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
@controller = WatchersController.new
|
|
||||||
@request = ActionController::TestRequest.new
|
|
||||||
@response = ActionController::TestResponse.new
|
|
||||||
User.current = nil
|
User.current = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -16,18 +16,11 @@
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
require File.expand_path('../../test_helper', __FILE__)
|
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
|
class WelcomeControllerTest < ActionController::TestCase
|
||||||
fixtures :projects, :news, :users, :members
|
fixtures :projects, :news, :users, :members
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
@controller = WelcomeController.new
|
|
||||||
@request = ActionController::TestRequest.new
|
|
||||||
@response = ActionController::TestResponse.new
|
|
||||||
User.current = nil
|
User.current = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -16,10 +16,6 @@
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
require File.expand_path('../../test_helper', __FILE__)
|
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
|
class WikiControllerTest < ActionController::TestCase
|
||||||
fixtures :projects, :users, :roles, :members, :member_roles,
|
fixtures :projects, :users, :roles, :members, :member_roles,
|
||||||
|
@ -27,9 +23,6 @@ class WikiControllerTest < ActionController::TestCase
|
||||||
:wiki_content_versions, :attachments
|
:wiki_content_versions, :attachments
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
@controller = WikiController.new
|
|
||||||
@request = ActionController::TestRequest.new
|
|
||||||
@response = ActionController::TestResponse.new
|
|
||||||
User.current = nil
|
User.current = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -16,18 +16,11 @@
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
require File.expand_path('../../test_helper', __FILE__)
|
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
|
class WikisControllerTest < ActionController::TestCase
|
||||||
fixtures :projects, :users, :roles, :members, :member_roles, :enabled_modules, :wikis
|
fixtures :projects, :users, :roles, :members, :member_roles, :enabled_modules, :wikis
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
@controller = WikisController.new
|
|
||||||
@request = ActionController::TestRequest.new
|
|
||||||
@response = ActionController::TestResponse.new
|
|
||||||
User.current = nil
|
User.current = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -16,18 +16,11 @@
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
require File.expand_path('../../test_helper', __FILE__)
|
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
|
class WorkflowsControllerTest < ActionController::TestCase
|
||||||
fixtures :roles, :trackers, :workflows, :users, :issue_statuses
|
fixtures :roles, :trackers, :workflows, :users, :issue_statuses
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
@controller = WorkflowsController.new
|
|
||||||
@request = ActionController::TestRequest.new
|
|
||||||
@response = ActionController::TestResponse.new
|
|
||||||
User.current = nil
|
User.current = nil
|
||||||
@request.session[:user_id] = 1 # admin
|
@request.session[:user_id] = 1 # admin
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue