replace RAILS_ROOT to Rails.root at test/test_helper.rb.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@6103 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2011-06-20 12:33:58 +00:00
parent 2a888e0ea6
commit e4d082a421

View File

@ -106,24 +106,24 @@ class ActiveSupport::TestCase
# LDAP is not listening # LDAP is not listening
return nil return nil
end end
# Returns the path to the test +vendor+ repository # Returns the path to the test +vendor+ repository
def self.repository_path(vendor) def self.repository_path(vendor)
File.join(RAILS_ROOT.gsub(%r{config\/\.\.}, ''), "/tmp/test/#{vendor.downcase}_repository") Rails.root.join("tmp/test/#{vendor.downcase}_repository").to_s
end end
# Returns the url of the subversion test repository # Returns the url of the subversion test repository
def self.subversion_repository_url def self.subversion_repository_url
path = repository_path('subversion') path = repository_path('subversion')
path = '/' + path unless path.starts_with?('/') path = '/' + path unless path.starts_with?('/')
"file://#{path}" "file://#{path}"
end end
# Returns true if the +vendor+ test repository is configured # Returns true if the +vendor+ test repository is configured
def self.repository_configured?(vendor) def self.repository_configured?(vendor)
File.directory?(repository_path(vendor)) File.directory?(repository_path(vendor))
end end
def assert_error_tag(options={}) def assert_error_tag(options={})
assert_tag({:attributes => { :id => 'errorExplanation' }}.merge(options)) assert_tag({:attributes => { :id => 'errorExplanation' }}.merge(options))
end end