scm: mercurial: replace RAILS_ROOT to Rails.root in unit model test.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@6051 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
3baabca8f2
commit
7e38ccab55
|
@ -20,13 +20,10 @@ require File.expand_path('../../test_helper', __FILE__)
|
||||||
class RepositoryMercurialTest < ActiveSupport::TestCase
|
class RepositoryMercurialTest < ActiveSupport::TestCase
|
||||||
fixtures :projects
|
fixtures :projects
|
||||||
|
|
||||||
# No '..' in the repository path
|
REPOSITORY_PATH = Rails.root.join('tmp/test/mercurial_repository').to_s
|
||||||
REPOSITORY_PATH = RAILS_ROOT.gsub(%r{config\/\.\.}, '') + '/tmp/test/mercurial_repository'
|
|
||||||
|
|
||||||
CHAR_1_HEX = "\xc3\x9c"
|
CHAR_1_HEX = "\xc3\x9c"
|
||||||
|
|
||||||
if File.directory?(REPOSITORY_PATH)
|
if File.directory?(REPOSITORY_PATH)
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
klass = Repository::Mercurial
|
klass = Repository::Mercurial
|
||||||
assert_equal "Mercurial", klass.scm_name
|
assert_equal "Mercurial", klass.scm_name
|
||||||
|
@ -34,7 +31,7 @@ class RepositoryMercurialTest < ActiveSupport::TestCase
|
||||||
assert_not_equal "", klass.scm_command
|
assert_not_equal "", klass.scm_command
|
||||||
assert_equal true, klass.scm_available
|
assert_equal true, klass.scm_available
|
||||||
|
|
||||||
@project = Project.find(3)
|
@project = Project.find(3)
|
||||||
@repository = Repository::Mercurial.create(
|
@repository = Repository::Mercurial.create(
|
||||||
:project => @project,
|
:project => @project,
|
||||||
:url => REPOSITORY_PATH,
|
:url => REPOSITORY_PATH,
|
||||||
|
|
Loading…
Reference in New Issue