require File.expand_path('../../test_helper', __FILE__)
-class AccountTest < ActionDispatch::IntegrationTest
+class AccountTest < Redmine::IntegrationTest
fixtures :users, :roles
def test_login
require File.expand_path('../../test_helper', __FILE__)
-class AdminTest < ActionDispatch::IntegrationTest
+class AdminTest < Redmine::IntegrationTest
fixtures :projects, :trackers, :issue_statuses, :issues,
:enumerations, :users, :issue_categories,
:projects_trackers,
require File.expand_path('../../test_helper', __FILE__)
-class ApplicationTest < ActionDispatch::IntegrationTest
+class ApplicationTest < Redmine::IntegrationTest
include Redmine::I18n
fixtures :projects, :trackers, :issue_statuses, :issues,
require File.expand_path('../../test_helper', __FILE__)
-class AttachmentsTest < ActionDispatch::IntegrationTest
+class AttachmentsTest < Redmine::IntegrationTest
fixtures :projects, :enabled_modules,
:users, :roles, :members, :member_roles,
:trackers, :projects_trackers,
require File.expand_path('../../test_helper', __FILE__)
-class FeedsTest < ActionDispatch::IntegrationTest
+class FeedsTest < Redmine::IntegrationTest
fixtures :projects, :trackers, :issue_statuses, :issues,
:enumerations, :users, :issue_categories,
:projects_trackers, :enabled_modules,
require File.expand_path('../../test_helper', __FILE__)
-class IssuesTest < ActionDispatch::IntegrationTest
+class IssuesTest < Redmine::IntegrationTest
fixtures :projects,
:users,
:roles,
require File.expand_path('../../test_helper', __FILE__)
-class LayoutTest < ActionDispatch::IntegrationTest
+class LayoutTest < Redmine::IntegrationTest
fixtures :projects, :trackers, :issue_statuses, :issues,
:enumerations, :users, :issue_categories,
:projects_trackers,
require File.expand_path('../../../../test_helper', __FILE__)
-class HookTest < ActionDispatch::IntegrationTest
+class HookTest < Redmine::IntegrationTest
fixtures :users, :roles, :projects, :members, :member_roles
# Hooks that are manually registered later
require File.expand_path('../../../../test_helper', __FILE__)
-class MenuManagerTest < ActionDispatch::IntegrationTest
+class MenuManagerTest < Redmine::IntegrationTest
include Redmine::I18n
fixtures :projects, :trackers, :issue_statuses, :issues,
require File.expand_path('../../../../test_helper', __FILE__)
-class ThemesTest < ActionDispatch::IntegrationTest
+class ThemesTest < Redmine::IntegrationTest
def setup
@theme = Redmine::Themes.themes.last
require File.expand_path('../../test_helper', __FILE__)
-class ProjectsTest < ActionDispatch::IntegrationTest
+class ProjectsTest < Redmine::IntegrationTest
fixtures :projects, :users, :members, :enabled_modules
def test_archive_project
require File.expand_path('../../test_helper', __FILE__)
-class RepositoriesGitTest < ActionDispatch::IntegrationTest
+class RepositoriesGitTest < Redmine::IntegrationTest
fixtures :projects, :users, :roles, :members, :member_roles,
:repositories, :enabled_modules
require File.expand_path('../../test_helper', __FILE__)
-class UsersTest < ActionDispatch::IntegrationTest
+class UsersTest < Redmine::IntegrationTest
fixtures :users
def test_destroy_should_not_accept_get_requests
ESCAPED_CANT = 'can't'
ESCAPED_UCANT = 'Can't'
- def log_user(login, password)
- User.anonymous
- get "/login"
- assert_equal nil, session[:user_id]
- assert_response :success
- assert_template "account/login"
- post "/login", :username => login, :password => password
- assert_equal login, User.find(session[:user_id]).login
- end
-
def uploaded_test_file(name, mime)
fixture_file_upload("files/#{name}", mime, true)
end
- def credentials(user, password=nil)
- {'HTTP_AUTHORIZATION' => ActionController::HttpAuthentication::Basic.encode_credentials(user, password || user)}
- end
-
# Mock out a file
def self.mock_file
file = 'a_file.png'
end
end
+ class IntegrationTest < ActionDispatch::IntegrationTest
+ def log_user(login, password)
+ User.anonymous
+ get "/login"
+ assert_equal nil, session[:user_id]
+ assert_response :success
+ assert_template "account/login"
+ post "/login", :username => login, :password => password
+ assert_equal login, User.find(session[:user_id]).login
+ end
+
+ def credentials(user, password=nil)
+ {'HTTP_AUTHORIZATION' => ActionController::HttpAuthentication::Basic.encode_credentials(user, password || user)}
+ end
+ end
+
module ApiTest
API_FORMATS = %w(json xml).freeze
# Base class for API tests
- class Base < ActionDispatch::IntegrationTest
+ class Base < Redmine::IntegrationTest
def setup
Setting.rest_api_enabled = '1'
end