From: Toshi MARUYAMA Date: Sat, 5 May 2012 05:29:43 +0000 (+0000) Subject: test: route: scm: move changes action tests to non revisions path tests X-Git-Tag: 2.0.0~56 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=66d62504ef2d88b2a673e40b827fdd1c3c407e16;p=redmine.git test: route: scm: move changes action tests to non revisions path tests git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9627 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/test/integration/routing/repositories_test.rb b/test/integration/routing/repositories_test.rb index 17d391801..2351721bb 100644 --- a/test/integration/routing/repositories_test.rb +++ b/test/integration/routing/repositories_test.rb @@ -132,31 +132,6 @@ class RoutingRepositoriesTest < ActionController::IntegrationTest { :controller => 'repositories', :action => 'show', :id => 'redmine', :path => @path_hash[:param] , :rev => '2457'} ) - assert_routing( - { :method => 'get', - :path => "/projects/redmine/repository/changes" }, - { :controller => 'repositories', :action => 'changes', :id => 'redmine' } - ) - ['2457', 'master', 'slash/slash'].each do |rev| - assert_routing( - { :method => 'get', - :path => "/projects/redmine/repository/changes" }, - { :controller => 'repositories', :action => 'changes', :id => 'redmine', - :rev => rev }, - {}, - { :rev => rev } - ) - end - ['2457', 'master', 'slash/slash'].each do |rev| - assert_routing( - { :method => 'get', - :path => "/projects/redmine/repository/changes/#{@path_hash[:path]}" }, - { :controller => 'repositories', :action => 'changes', :id => 'redmine', - :path => @path_hash[:param], :rev => rev }, - {}, - { :rev => rev } - ) - end assert_routing( { :method => 'get', :path => "/projects/redmine/repository/revisions/2457/diff" }, @@ -226,31 +201,6 @@ class RoutingRepositoriesTest < ActionController::IntegrationTest { :controller => 'repositories', :action => 'show', :id => 'redmine', :repository_id => 'foo', :path => @path_hash[:param] , :rev => '2457'} ) - assert_routing( - { :method => 'get', - :path => "/projects/redmine/repository/foo/changes" }, - { :controller => 'repositories', :action => 'changes', :id => 'redmine', :repository_id => 'foo' } - ) - ['2457', 'master', 'slash/slash'].each do |rev| - assert_routing( - { :method => 'get', - :path => "/projects/redmine/repository/foo/changes" }, - { :controller => 'repositories', :action => 'changes', :id => 'redmine', - :repository_id => 'foo', :rev => rev }, - {}, - { :rev => rev } - ) - end - ['2457', 'master', 'slash/slash'].each do |rev| - assert_routing( - { :method => 'get', - :path => "/projects/redmine/repository/foo/changes/#{@path_hash[:path]}" }, - { :controller => 'repositories', :action => 'changes', :id => 'redmine', - :repository_id => 'foo', :path => @path_hash[:param], :rev => rev }, - {}, - { :rev => rev } - ) - end assert_routing( { :method => 'get', :path => "/projects/redmine/repository/foo/revisions/2457/diff" }, @@ -290,6 +240,31 @@ class RoutingRepositoriesTest < ActionController::IntegrationTest end def test_repositories_non_revisions_path + assert_routing( + { :method => 'get', + :path => "/projects/redmine/repository/changes" }, + { :controller => 'repositories', :action => 'changes', :id => 'redmine' } + ) + ['2457', 'master', 'slash/slash'].each do |rev| + assert_routing( + { :method => 'get', + :path => "/projects/redmine/repository/changes" }, + { :controller => 'repositories', :action => 'changes', :id => 'redmine', + :rev => rev }, + {}, + { :rev => rev } + ) + end + ['2457', 'master', 'slash/slash'].each do |rev| + assert_routing( + { :method => 'get', + :path => "/projects/redmine/repository/changes/#{@path_hash[:path]}" }, + { :controller => 'repositories', :action => 'changes', :id => 'redmine', + :path => @path_hash[:param], :rev => rev }, + {}, + { :rev => rev } + ) + end assert_routing( { :method => 'get', :path => "/projects/redmine/repository/diff/#{@path_hash[:path]}" }, @@ -334,6 +309,33 @@ class RoutingRepositoriesTest < ActionController::IntegrationTest end def test_repositories_non_revisions_path_with_repository_id + assert_routing( + { :method => 'get', + :path => "/projects/redmine/repository/foo/changes" }, + { :controller => 'repositories', :action => 'changes', + :id => 'redmine', :repository_id => 'foo' } + ) + ['2457', 'master', 'slash/slash'].each do |rev| + assert_routing( + { :method => 'get', + :path => "/projects/redmine/repository/foo/changes" }, + { :controller => 'repositories', :action => 'changes', + :id => 'redmine', + :repository_id => 'foo', :rev => rev }, + {}, + { :rev => rev } + ) + end + ['2457', 'master', 'slash/slash'].each do |rev| + assert_routing( + { :method => 'get', + :path => "/projects/redmine/repository/foo/changes/#{@path_hash[:path]}" }, + { :controller => 'repositories', :action => 'changes', :id => 'redmine', + :repository_id => 'foo', :path => @path_hash[:param], :rev => rev }, + {}, + { :rev => rev } + ) + end assert_routing( { :method => 'get', :path => "/projects/redmine/repository/foo/diff/#{@path_hash[:path]}" },