Rails3: test: scm: bazaar: use "repository_path_hash" for path param

Rails3 new route format returns path param as string not array.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8927 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2012-02-23 08:49:05 +00:00
parent 00ec4e189f
commit d086683b17
1 changed files with 14 additions and 7 deletions

View File

@ -58,7 +58,7 @@ class RepositoriesBazaarControllerTest < ActionController::TestCase
end
def test_browse_directory
get :show, :id => PRJ_ID, :path => ['directory']
get :show, :id => PRJ_ID, :path => repository_path_hash(['directory'])[:param]
assert_response :success
assert_template 'show'
assert_not_nil assigns(:entries)
@ -70,7 +70,8 @@ class RepositoriesBazaarControllerTest < ActionController::TestCase
end
def test_browse_at_given_revision
get :show, :id => PRJ_ID, :path => [], :rev => 3
get :show, :id => PRJ_ID, :path => repository_path_hash([])[:param],
:rev => 3
assert_response :success
assert_template 'show'
assert_not_nil assigns(:entries)
@ -79,14 +80,16 @@ class RepositoriesBazaarControllerTest < ActionController::TestCase
end
def test_changes
get :changes, :id => PRJ_ID, :path => ['doc-mkdir.txt']
get :changes, :id => PRJ_ID,
:path => repository_path_hash(['doc-mkdir.txt'])[:param]
assert_response :success
assert_template 'changes'
assert_tag :tag => 'h2', :content => 'doc-mkdir.txt'
end
def test_entry_show
get :entry, :id => PRJ_ID, :path => ['directory', 'doc-ls.txt']
get :entry, :id => PRJ_ID,
:path => repository_path_hash(['directory', 'doc-ls.txt'])[:param]
assert_response :success
assert_template 'entry'
# Line 19
@ -97,14 +100,17 @@ class RepositoriesBazaarControllerTest < ActionController::TestCase
end
def test_entry_download
get :entry, :id => PRJ_ID, :path => ['directory', 'doc-ls.txt'], :format => 'raw'
get :entry, :id => PRJ_ID,
:path => repository_path_hash(['directory', 'doc-ls.txt'])[:param],
:format => 'raw'
assert_response :success
# File content
assert @response.body.include?('Show help message')
end
def test_directory_entry
get :entry, :id => PRJ_ID, :path => ['directory']
get :entry, :id => PRJ_ID,
:path => repository_path_hash(['directory'])[:param]
assert_response :success
assert_template 'show'
assert_not_nil assigns(:entry)
@ -127,7 +133,8 @@ class RepositoriesBazaarControllerTest < ActionController::TestCase
end
def test_annotate
get :annotate, :id => PRJ_ID, :path => ['doc-mkdir.txt']
get :annotate, :id => PRJ_ID,
:path => repository_path_hash(['doc-mkdir.txt'])[:param]
assert_response :success
assert_template 'annotate'
assert_tag :tag => 'th', :content => '2',