##// END OF EJS Templates
Speeds up rendering of the project list for users who belong to hundreds of projects....
Speeds up rendering of the project list for users who belong to hundreds of projects. git-svn-id: http://svn.redmine.org/redmine/trunk@16123 e93f8b46-1217-0410-a6f0-8f06a7374b81

File last commit:

r14856:cda9c63d9c21
r15741:f8df935dcada
Show More
repositories_test.rb
139 lines | 8.9 KiB | text/x-ruby | RubyLexer
Toshi MARUYAMA
test: route: move repositories test to new file...
r8220 # Redmine - project management software
Jean-Philippe Lang
Updates copyright for 2016....
r14856 # Copyright (C) 2006-2016 Jean-Philippe Lang
Toshi MARUYAMA
test: route: move repositories test to new file...
r8220 #
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require File.expand_path('../../../test_helper', __FILE__)
Jean-Philippe Lang
Use should_route in routing tests....
r13226 class RoutingRepositoriesTest < Redmine::RoutingTest
Toshi MARUYAMA
Rails3: test: route: add private method to convert path parameter at repositories test...
r8378 def setup
@path_hash = repository_path_hash(%w[path to file.c])
assert_equal "path/to/file.c", @path_hash[:path]
Jean-Philippe Lang
Merged rails-3.2 branch....
r9346 assert_equal "path/to/file.c", @path_hash[:param]
Toshi MARUYAMA
Rails3: test: route: add private method to convert path parameter at repositories test...
r8378 end
Jean-Philippe Lang
Resourcified repositories for CRUD operations to prepare for multiple SCM per project (#779)....
r8528 def test_repositories_resources
Jean-Philippe Lang
Use should_route in routing tests....
r13226 should_route 'GET /projects/foo/repositories/new' => 'repositories#new', :project_id => 'foo'
should_route 'POST /projects/foo/repositories' => 'repositories#create', :project_id => 'foo'
should_route 'GET /repositories/1/edit' => 'repositories#edit', :id => '1'
should_route 'PUT /repositories/1' => 'repositories#update', :id => '1'
should_route 'DELETE /repositories/1' => 'repositories#destroy', :id => '1'
Jean-Philippe Lang
Resourcified repositories for CRUD operations to prepare for multiple SCM per project (#779)....
r8528
Jean-Philippe Lang
Use should_route in routing tests....
r13226 should_route 'GET /repositories/1/committers' => 'repositories#committers', :id => '1'
should_route 'POST /repositories/1/committers' => 'repositories#committers', :id => '1'
Toshi MARUYAMA
test: route: repositories: split tests whether 'show' action or not...
r8595 end
def test_repositories
Jean-Philippe Lang
Use should_route in routing tests....
r13226 should_route 'GET /projects/foo/repository' => 'repositories#show', :id => 'foo'
should_route 'GET /projects/foo/repository/statistics' => 'repositories#stats', :id => 'foo'
should_route 'GET /projects/foo/repository/graph' => 'repositories#graph', :id => 'foo'
Toshi MARUYAMA
test: route: repositories: split tests whether 'show' action or not...
r8595 end
def test_repositories_with_repository_id
Jean-Philippe Lang
Use should_route in routing tests....
r13226 should_route 'GET /projects/foo/repository/svn' => 'repositories#show', :id => 'foo', :repository_id => 'svn'
should_route 'GET /projects/foo/repository/svn/statistics' => 'repositories#stats', :id => 'foo', :repository_id => 'svn'
should_route 'GET /projects/foo/repository/svn/graph' => 'repositories#graph', :id => 'foo', :repository_id => 'svn'
Toshi MARUYAMA
test: route: split repository route test...
r8284 end
def test_repositories_revisions
Jean-Philippe Lang
Use should_route in routing tests....
r13226 should_route 'GET /projects/foo/repository/revision' => 'repositories#revision', :id => 'foo'
should_route 'GET /projects/foo/repository/revisions' => 'repositories#revisions', :id => 'foo'
should_route 'GET /projects/foo/repository/revisions.atom' => 'repositories#revisions', :id => 'foo', :format => 'atom'
should_route 'GET /projects/foo/repository/revisions/2457' => 'repositories#revision', :id => 'foo', :rev => '2457'
should_route 'GET /projects/foo/repository/revisions/2457/show' => 'repositories#show', :id => 'foo', :rev => '2457'
should_route 'GET /projects/foo/repository/revisions/2457/diff' => 'repositories#diff', :id => 'foo', :rev => '2457'
should_route "GET /projects/foo/repository/revisions/2457/show/#{@path_hash[:path]}" => 'repositories#show',
:id => 'foo', :rev => '2457', :path => @path_hash[:param]
should_route "GET /projects/foo/repository/revisions/2457/diff/#{@path_hash[:path]}" => 'repositories#diff',
:id => 'foo', :rev => '2457', :path => @path_hash[:param]
should_route "GET /projects/foo/repository/revisions/2457/entry/#{@path_hash[:path]}" => 'repositories#entry',
:id => 'foo', :rev => '2457', :path => @path_hash[:param]
should_route "GET /projects/foo/repository/revisions/2457/raw/#{@path_hash[:path]}" => 'repositories#raw',
:id => 'foo', :rev => '2457', :path => @path_hash[:param]
should_route "GET /projects/foo/repository/revisions/2457/annotate/#{@path_hash[:path]}" => 'repositories#annotate',
:id => 'foo', :rev => '2457', :path => @path_hash[:param]
Toshi MARUYAMA
test: route: split repository route test...
r8284 end
Jean-Philippe Lang
Adds support for multiple repositories per project (#779)....
r8530 def test_repositories_revisions_with_repository_id
Jean-Philippe Lang
Use should_route in routing tests....
r13226 should_route 'GET /projects/foo/repository/foo/revision' => 'repositories#revision', :id => 'foo', :repository_id => 'foo'
should_route 'GET /projects/foo/repository/foo/revisions' => 'repositories#revisions', :id => 'foo', :repository_id => 'foo'
should_route 'GET /projects/foo/repository/foo/revisions.atom' => 'repositories#revisions', :id => 'foo', :repository_id => 'foo', :format => 'atom'
should_route 'GET /projects/foo/repository/foo/revisions/2457' => 'repositories#revision', :id => 'foo', :repository_id => 'foo', :rev => '2457'
should_route 'GET /projects/foo/repository/foo/revisions/2457/show' => 'repositories#show', :id => 'foo', :repository_id => 'foo', :rev => '2457'
should_route 'GET /projects/foo/repository/foo/revisions/2457/diff' => 'repositories#diff', :id => 'foo', :repository_id => 'foo', :rev => '2457'
should_route "GET /projects/foo/repository/foo/revisions/2457/show/#{@path_hash[:path]}" => 'repositories#show',
:id => 'foo', :repository_id => 'foo', :rev => '2457', :path => @path_hash[:param]
should_route "GET /projects/foo/repository/foo/revisions/2457/diff/#{@path_hash[:path]}" => 'repositories#diff',
:id => 'foo', :repository_id => 'foo', :rev => '2457', :path => @path_hash[:param]
should_route "GET /projects/foo/repository/foo/revisions/2457/entry/#{@path_hash[:path]}" => 'repositories#entry',
:id => 'foo', :repository_id => 'foo', :rev => '2457', :path => @path_hash[:param]
should_route "GET /projects/foo/repository/foo/revisions/2457/raw/#{@path_hash[:path]}" => 'repositories#raw',
:id => 'foo', :repository_id => 'foo', :rev => '2457', :path => @path_hash[:param]
should_route "GET /projects/foo/repository/foo/revisions/2457/annotate/#{@path_hash[:path]}" => 'repositories#annotate',
:id => 'foo', :repository_id => 'foo', :rev => '2457', :path => @path_hash[:param]
Jean-Philippe Lang
Adds support for multiple repositories per project (#779)....
r8530 end
Toshi MARUYAMA
test: route: simplify repositories test...
r8376 def test_repositories_non_revisions_path
Jean-Philippe Lang
Use should_route in routing tests....
r13226 should_route 'GET /projects/foo/repository/changes' => 'repositories#changes', :id => 'foo'
should_route "GET /projects/foo/repository/changes/#{@path_hash[:path]}" => 'repositories#changes',
:id => 'foo', :path => @path_hash[:param]
should_route "GET /projects/foo/repository/diff/#{@path_hash[:path]}" => 'repositories#diff',
:id => 'foo', :path => @path_hash[:param]
should_route "GET /projects/foo/repository/browse/#{@path_hash[:path]}" => 'repositories#browse',
:id => 'foo', :path => @path_hash[:param]
should_route "GET /projects/foo/repository/entry/#{@path_hash[:path]}" => 'repositories#entry',
:id => 'foo', :path => @path_hash[:param]
should_route "GET /projects/foo/repository/raw/#{@path_hash[:path]}" => 'repositories#raw',
:id => 'foo', :path => @path_hash[:param]
should_route "GET /projects/foo/repository/annotate/#{@path_hash[:path]}" => 'repositories#annotate',
:id => 'foo', :path => @path_hash[:param]
Toshi MARUYAMA
test: route: move repositories test to new file...
r8220 end
Toshi MARUYAMA
Rails3: test: route: add private method to convert path parameter at repositories test...
r8378
Jean-Philippe Lang
Adds support for multiple repositories per project (#779)....
r8530 def test_repositories_non_revisions_path_with_repository_id
Jean-Philippe Lang
Use should_route in routing tests....
r13226 should_route 'GET /projects/foo/repository/svn/changes' => 'repositories#changes', :id => 'foo', :repository_id => 'svn'
should_route "GET /projects/foo/repository/svn/changes/#{@path_hash[:path]}" => 'repositories#changes',
:id => 'foo', :repository_id => 'svn', :path => @path_hash[:param]
should_route "GET /projects/foo/repository/svn/diff/#{@path_hash[:path]}" => 'repositories#diff',
:id => 'foo', :repository_id => 'svn', :path => @path_hash[:param]
should_route "GET /projects/foo/repository/svn/browse/#{@path_hash[:path]}" => 'repositories#browse',
:id => 'foo', :repository_id => 'svn', :path => @path_hash[:param]
should_route "GET /projects/foo/repository/svn/entry/#{@path_hash[:path]}" => 'repositories#entry',
:id => 'foo', :repository_id => 'svn', :path => @path_hash[:param]
should_route "GET /projects/foo/repository/svn/raw/#{@path_hash[:path]}" => 'repositories#raw',
:id => 'foo', :repository_id => 'svn', :path => @path_hash[:param]
should_route "GET /projects/foo/repository/svn/annotate/#{@path_hash[:path]}" => 'repositories#annotate',
:id => 'foo', :repository_id => 'svn', :path => @path_hash[:param]
Jean-Philippe Lang
Adds support for multiple repositories per project (#779)....
r8530 end
Jean-Philippe Lang
Adds a "Manage related isses" permission to add/remove commits/issues relations manually from the changeset view (#2009)....
r8657 def test_repositories_related_issues
Jean-Philippe Lang
Use should_route in routing tests....
r13226 should_route 'POST /projects/foo/repository/revisions/123/issues' => 'repositories#add_related_issue',
:id => 'foo', :rev => '123'
should_route 'DELETE /projects/foo/repository/revisions/123/issues/25' => 'repositories#remove_related_issue',
:id => 'foo', :rev => '123', :issue_id => '25'
Jean-Philippe Lang
Adds a "Manage related isses" permission to add/remove commits/issues relations manually from the changeset view (#2009)....
r8657 end
def test_repositories_related_issues_with_repository_id
Jean-Philippe Lang
Use should_route in routing tests....
r13226 should_route 'POST /projects/foo/repository/svn/revisions/123/issues' => 'repositories#add_related_issue',
:id => 'foo', :repository_id => 'svn', :rev => '123'
should_route 'DELETE /projects/foo/repository/svn/revisions/123/issues/25' => 'repositories#remove_related_issue',
:id => 'foo', :repository_id => 'svn', :rev => '123', :issue_id => '25'
Jean-Philippe Lang
Adds a "Manage related isses" permission to add/remove commits/issues relations manually from the changeset view (#2009)....
r8657 end
Toshi MARUYAMA
test: route: move repositories test to new file...
r8220 end