route: scm: split entry and raw actions

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9625 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA
2012-05-05 01:01:29 +00:00
parent 569e1b37cc
commit b0414ec1fb
7 changed files with 35 additions and 34 deletions

View File

@@ -78,8 +78,7 @@ class RepositoriesFilesystemControllerTest < ActionController::TestCase
end
def test_entry_download_no_extension
get :entry, :id => PRJ_ID, :path => repository_path_hash(['test'])[:param],
:format => 'raw'
get :raw, :id => PRJ_ID, :path => repository_path_hash(['test'])[:param]
assert_response :success
assert_equal 'application/octet-stream', @response.content_type
end

View File

@@ -216,9 +216,8 @@ class RepositoriesSubversionControllerTest < ActionController::TestCase
@repository.fetch_changesets
@project.reload
assert_equal NUM_REV, @repository.changesets.count
get :entry, :id => PRJ_ID,
:path => repository_path_hash(['subversion_test', 'helloworld.c'])[:param],
:format => 'raw'
get :raw, :id => PRJ_ID,
:path => repository_path_hash(['subversion_test', 'helloworld.c'])[:param]
assert_response :success
assert_equal 'attachment; filename="helloworld.c"', @response.headers['Content-Disposition']
end

View File

@@ -184,8 +184,8 @@ class RoutingRepositoriesTest < ActionController::IntegrationTest
assert_routing(
{ :method => 'get',
:path => "/projects/redmine/repository/revisions/2/raw/#{@path_hash[:path]}" },
{ :controller => 'repositories', :action => 'entry', :id => 'redmine',
:path => @path_hash[:param], :rev => '2', :format => 'raw' }
{ :controller => 'repositories', :action => 'raw', :id => 'redmine',
:path => @path_hash[:param], :rev => '2' }
)
assert_routing(
{ :method => 'get',
@@ -278,8 +278,8 @@ class RoutingRepositoriesTest < ActionController::IntegrationTest
assert_routing(
{ :method => 'get',
:path => "/projects/redmine/repository/foo/revisions/2/raw/#{@path_hash[:path]}" },
{ :controller => 'repositories', :action => 'entry', :id => 'redmine', :repository_id => 'foo',
:path => @path_hash[:param], :rev => '2', :format => 'raw' }
{ :controller => 'repositories', :action => 'raw', :id => 'redmine', :repository_id => 'foo',
:path => @path_hash[:param], :rev => '2' }
)
assert_routing(
{ :method => 'get',
@@ -311,8 +311,8 @@ class RoutingRepositoriesTest < ActionController::IntegrationTest
assert_routing(
{ :method => 'get',
:path => "/projects/redmine/repository/raw/#{@path_hash[:path]}" },
{ :controller => 'repositories', :action => 'entry', :id => 'redmine',
:path => @path_hash[:param], :format => 'raw' }
{ :controller => 'repositories', :action => 'raw', :id => 'redmine',
:path => @path_hash[:param] }
)
assert_routing(
{ :method => 'get',
@@ -355,8 +355,8 @@ class RoutingRepositoriesTest < ActionController::IntegrationTest
assert_routing(
{ :method => 'get',
:path => "/projects/redmine/repository/foo/raw/#{@path_hash[:path]}" },
{ :controller => 'repositories', :action => 'entry', :id => 'redmine', :repository_id => 'foo',
:path => @path_hash[:param], :format => 'raw' }
{ :controller => 'repositories', :action => 'raw', :id => 'redmine', :repository_id => 'foo',
:path => @path_hash[:param] }
)
assert_routing(
{ :method => 'get',