Refactor: Move the rest of the routing tests to RoutingTest.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3687 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -31,38 +31,6 @@ class RepositoriesControllerTest < ActionController::TestCase
|
||||
User.current = nil
|
||||
end
|
||||
|
||||
def test_show_routing
|
||||
assert_routing(
|
||||
{:method => :get, :path => '/projects/redmine/repository'},
|
||||
:controller => 'repositories', :action => 'show', :id => 'redmine'
|
||||
)
|
||||
end
|
||||
|
||||
def test_edit_routing
|
||||
assert_routing(
|
||||
{:method => :get, :path => '/projects/world_domination/repository/edit'},
|
||||
:controller => 'repositories', :action => 'edit', :id => 'world_domination'
|
||||
)
|
||||
assert_routing(
|
||||
{:method => :post, :path => '/projects/world_domination/repository/edit'},
|
||||
:controller => 'repositories', :action => 'edit', :id => 'world_domination'
|
||||
)
|
||||
end
|
||||
|
||||
def test_revisions_routing
|
||||
assert_routing(
|
||||
{:method => :get, :path => '/projects/redmine/repository/revisions'},
|
||||
:controller => 'repositories', :action => 'revisions', :id => 'redmine'
|
||||
)
|
||||
end
|
||||
|
||||
def test_revisions_atom_routing
|
||||
assert_routing(
|
||||
{:method => :get, :path => '/projects/redmine/repository/revisions.atom'},
|
||||
:controller => 'repositories', :action => 'revisions', :id => 'redmine', :format => 'atom'
|
||||
)
|
||||
end
|
||||
|
||||
def test_revisions
|
||||
get :revisions, :id => 1
|
||||
assert_response :success
|
||||
@@ -70,13 +38,6 @@ class RepositoriesControllerTest < ActionController::TestCase
|
||||
assert_not_nil assigns(:changesets)
|
||||
end
|
||||
|
||||
def test_revision_routing
|
||||
assert_routing(
|
||||
{:method => :get, :path => '/projects/restmine/repository/revisions/2457'},
|
||||
:controller => 'repositories', :action => 'revision', :id => 'restmine', :rev => '2457'
|
||||
)
|
||||
end
|
||||
|
||||
def test_revision
|
||||
get :revision, :id => 1, :rev => 1
|
||||
assert_response :success
|
||||
@@ -96,90 +57,6 @@ class RepositoriesControllerTest < ActionController::TestCase
|
||||
}
|
||||
end
|
||||
|
||||
def test_diff_routing
|
||||
assert_routing(
|
||||
{:method => :get, :path => '/projects/restmine/repository/revisions/2457/diff'},
|
||||
:controller => 'repositories', :action => 'diff', :id => 'restmine', :rev => '2457'
|
||||
)
|
||||
end
|
||||
|
||||
def test_unified_diff_routing
|
||||
assert_routing(
|
||||
{:method => :get, :path => '/projects/restmine/repository/revisions/2457/diff.diff'},
|
||||
:controller => 'repositories', :action => 'diff', :id => 'restmine', :rev => '2457', :format => 'diff'
|
||||
)
|
||||
end
|
||||
|
||||
def test_diff_path_routing
|
||||
assert_routing(
|
||||
{:method => :get, :path => '/projects/restmine/repository/diff/path/to/file.c'},
|
||||
:controller => 'repositories', :action => 'diff', :id => 'restmine', :path => %w[path to file.c]
|
||||
)
|
||||
end
|
||||
|
||||
def test_diff_path_routing_with_revision
|
||||
assert_routing(
|
||||
{:method => :get, :path => '/projects/restmine/repository/revisions/2/diff/path/to/file.c'},
|
||||
:controller => 'repositories', :action => 'diff', :id => 'restmine', :path => %w[path to file.c], :rev => '2'
|
||||
)
|
||||
end
|
||||
|
||||
def test_browse_routing
|
||||
assert_routing(
|
||||
{:method => :get, :path => '/projects/restmine/repository/browse/path/to/dir'},
|
||||
:controller => 'repositories', :action => 'browse', :id => 'restmine', :path => %w[path to dir]
|
||||
)
|
||||
end
|
||||
|
||||
def test_entry_routing
|
||||
assert_routing(
|
||||
{:method => :get, :path => '/projects/restmine/repository/entry/path/to/file.c'},
|
||||
:controller => 'repositories', :action => 'entry', :id => 'restmine', :path => %w[path to file.c]
|
||||
)
|
||||
end
|
||||
|
||||
def test_entry_routing_with_revision
|
||||
assert_routing(
|
||||
{:method => :get, :path => '/projects/restmine/repository/revisions/2/entry/path/to/file.c'},
|
||||
:controller => 'repositories', :action => 'entry', :id => 'restmine', :path => %w[path to file.c], :rev => '2'
|
||||
)
|
||||
end
|
||||
|
||||
def test_raw_routing
|
||||
assert_routing(
|
||||
{:method => :get, :path => '/projects/restmine/repository/raw/path/to/file.c'},
|
||||
:controller => 'repositories', :action => 'entry', :id => 'restmine', :path => %w[path to file.c], :format => 'raw'
|
||||
)
|
||||
end
|
||||
|
||||
def test_raw_routing_with_revision
|
||||
assert_routing(
|
||||
{:method => :get, :path => '/projects/restmine/repository/revisions/2/raw/path/to/file.c'},
|
||||
:controller => 'repositories', :action => 'entry', :id => 'restmine', :path => %w[path to file.c], :format => 'raw', :rev => '2'
|
||||
)
|
||||
end
|
||||
|
||||
def test_annotate_routing
|
||||
assert_routing(
|
||||
{:method => :get, :path => '/projects/restmine/repository/annotate/path/to/file.c'},
|
||||
:controller => 'repositories', :action => 'annotate', :id => 'restmine', :path => %w[path to file.c]
|
||||
)
|
||||
end
|
||||
|
||||
def test_changesrouting
|
||||
assert_routing(
|
||||
{:method => :get, :path => '/projects/restmine/repository/changes/path/to/file.c'},
|
||||
:controller => 'repositories', :action => 'changes', :id => 'restmine', :path => %w[path to file.c]
|
||||
)
|
||||
end
|
||||
|
||||
def test_statistics_routing
|
||||
assert_routing(
|
||||
{:method => :get, :path => '/projects/restmine/repository/statistics'},
|
||||
:controller => 'repositories', :action => 'stats', :id => 'restmine'
|
||||
)
|
||||
end
|
||||
|
||||
def test_graph_commits_per_month
|
||||
get :graph, :id => 1, :graph => 'commits_per_month'
|
||||
assert_response :success
|
||||
|
||||
Reference in New Issue
Block a user