Commit e3e67e63 authored by jplang's avatar jplang

Removes repository routes without repository_id (#26522).

git-svn-id: https://svn.redmine.org/redmine/trunk@17386 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 689c0e7a
......@@ -129,9 +129,7 @@ class Repository < ActiveRecord::Base
end
def identifier_param
if is_default?
nil
elsif identifier.present?
if identifier.present?
identifier
else
id.to_s
......
......@@ -253,21 +253,6 @@ Rails.application.routes.draw do
:constraints => {:rev => /[a-z0-9\.\-_]+/, :path => /.*/}
end
get 'projects/:id/repository/statistics', :to => 'repositories#stats'
get 'projects/:id/repository/graph', :to => 'repositories#graph'
get 'projects/:id/repository/revisions', :to => 'repositories#revisions'
get 'projects/:id/repository/revisions/:rev', :to => 'repositories#revision'
get 'projects/:id/repository/revision', :to => 'repositories#revision'
post 'projects/:id/repository/revisions/:rev/issues', :to => 'repositories#add_related_issue'
delete 'projects/:id/repository/revisions/:rev/issues/:issue_id', :to => 'repositories#remove_related_issue'
%w(browse show entry raw annotate diff).each do |action|
get "projects/:id/repository/revisions/:rev/#{action}(/*path)",
:controller => 'repositories',
:action => action,
:format => 'html',
:constraints => {:rev => /[a-z0-9\.\-_]+/, :path => /.*/}
end
%w(browse entry raw changes annotate diff).each do |action|
get "projects/:id/repository/:repository_id/#{action}(/*path)",
:controller => 'repositories',
......@@ -275,16 +260,8 @@ Rails.application.routes.draw do
:format => 'html',
:constraints => {:path => /.*/}
end
%w(browse entry raw changes annotate diff).each do |action|
get "projects/:id/repository/#{action}(/*path)",
:controller => 'repositories',
:action => action,
:format => 'html',
:constraints => {:path => /.*/}
end
get 'projects/:id/repository/:repository_id/show/*path', :to => 'repositories#show', :format => 'html', :constraints => {:path => /.*/}
get 'projects/:id/repository/show/*path', :to => 'repositories#show', :format => 'html', :constraints => {:path => /.*/}
get 'projects/:id/repository/:repository_id', :to => 'repositories#show', :path => nil
get 'projects/:id/repository', :to => 'repositories#show', :path => nil
......
......@@ -2033,7 +2033,7 @@ class IssuesControllerTest < Redmine::ControllerTest
:id => issue.id
}
assert_select 'a[href=?]', '/projects/ecookbook/repository/revisions/3'
assert_select 'a[href=?]', '/projects/ecookbook/repository/10/revisions/3'
end
def test_show_should_display_watchers
......
......@@ -68,6 +68,7 @@ class RepositoriesBazaarControllerTest < Redmine::RepositoryControllerTest
def test_browse_directory
get :show, :params => {
:id => PRJ_ID,
:repository_id => @repository.id,
:path => repository_path_hash(['directory'])[:param]
}
assert_response :success
......@@ -82,6 +83,7 @@ class RepositoriesBazaarControllerTest < Redmine::RepositoryControllerTest
def test_browse_at_given_revision
get :show, :params => {
:id => PRJ_ID,
:repository_id => @repository.id,
:path => repository_path_hash([])[:param],
:rev => 3
}
......@@ -98,6 +100,7 @@ class RepositoriesBazaarControllerTest < Redmine::RepositoryControllerTest
def test_changes
get :changes, :params => {
:id => PRJ_ID,
:repository_id => @repository.id,
:path => repository_path_hash(['doc-mkdir.txt'])[:param]
}
assert_response :success
......@@ -107,6 +110,7 @@ class RepositoriesBazaarControllerTest < Redmine::RepositoryControllerTest
def test_entry_show
get :entry, :params => {
:id => PRJ_ID,
:repository_id => @repository.id,
:path => repository_path_hash(['directory', 'doc-ls.txt'])[:param]
}
assert_response :success
......@@ -117,6 +121,7 @@ class RepositoriesBazaarControllerTest < Redmine::RepositoryControllerTest
def test_entry_download
get :entry, :params => {
:id => PRJ_ID,
:repository_id => @repository.id,
:path => repository_path_hash(['directory', 'doc-ls.txt'])[:param],
:format => 'raw'
}
......@@ -128,6 +133,7 @@ class RepositoriesBazaarControllerTest < Redmine::RepositoryControllerTest
def test_directory_entry
get :entry, :params => {
:id => PRJ_ID,
:repository_id => @repository.id,
:path => repository_path_hash(['directory'])[:param]
}
assert_response :success
......@@ -139,6 +145,7 @@ class RepositoriesBazaarControllerTest < Redmine::RepositoryControllerTest
['inline', 'sbs'].each do |dt|
get :diff, :params => {
:id => PRJ_ID,
:repository_id => @repository.id,
:rev => 3,
:type => dt
}
......@@ -151,6 +158,7 @@ class RepositoriesBazaarControllerTest < Redmine::RepositoryControllerTest
def test_annotate
get :annotate, :params => {
:id => PRJ_ID,
:repository_id => @repository.id,
:path => repository_path_hash(['doc-mkdir.txt'])[:param]
}
assert_response :success
......
......@@ -182,7 +182,8 @@ class RepositoriesControllerTest < Redmine::RepositoryControllerTest
def test_revisions
get :revisions, :params => {
:id => 1
:id => 1,
:repository_id => 10
}
assert_response :success
assert_select 'table.changesets'
......@@ -210,6 +211,7 @@ class RepositoriesControllerTest < Redmine::RepositoryControllerTest
def test_revision
get :revision, :params => {
:id => 1,
:repository_id => 10,
:rev => 1
}
assert_response :success
......@@ -222,6 +224,7 @@ class RepositoriesControllerTest < Redmine::RepositoryControllerTest
with_settings :commit_logs_formatting => '0' do
get :revision, :params => {
:id => 1,
:repository_id => 10,
:rev => 1
}
assert_response :success
......@@ -235,11 +238,12 @@ class RepositoriesControllerTest < Redmine::RepositoryControllerTest
get :revision, :params => {
:id => 1,
:repository_id => 10,
:rev => 1
}
assert_response :success
assert_select 'form[action=?]', '/projects/ecookbook/repository/revisions/1/issues' do
assert_select 'form[action=?]', '/projects/ecookbook/repository/10/revisions/1/issues' do
assert_select 'input[name=?]', 'issue_id'
end
end
......@@ -247,6 +251,7 @@ class RepositoriesControllerTest < Redmine::RepositoryControllerTest
def test_revision_should_not_change_the_project_menu_link
get :revision, :params => {
:id => 1,
:repository_id => 10,
:rev => 1
}
assert_response :success
......@@ -257,13 +262,14 @@ class RepositoriesControllerTest < Redmine::RepositoryControllerTest
def test_revision_with_before_nil_and_afer_normal
get :revision, :params => {
:id => 1,
:repository_id => 10,
:rev => 1
}
assert_response :success
assert_select 'div.contextual' do
assert_select 'a[href=?]', '/projects/ecookbook/repository/revisions/0', 0
assert_select 'a[href=?]', '/projects/ecookbook/repository/revisions/2'
assert_select 'a[href=?]', '/projects/ecookbook/repository/10/revisions/0', 0
assert_select 'a[href=?]', '/projects/ecookbook/repository/10/revisions/2'
end
end
......@@ -272,6 +278,7 @@ class RepositoriesControllerTest < Redmine::RepositoryControllerTest
assert_difference 'Changeset.find(103).issues.size' do
post :add_related_issue, :params => {
:id => 1,
:repository_id => 10,
:rev => 4,
:issue_id => 2,
:format => 'js'
......@@ -290,6 +297,7 @@ class RepositoriesControllerTest < Redmine::RepositoryControllerTest
assert_difference 'Changeset.find(103).issues.size' do
post :add_related_issue, :params => {
:id => 1,
:repository_id => 10,
:rev => 4,
:issue_id => "#2",
:format => 'js'
......@@ -304,6 +312,7 @@ class RepositoriesControllerTest < Redmine::RepositoryControllerTest
assert_no_difference 'Changeset.find(103).issues.size' do
post :add_related_issue, :params => {
:id => 1,
:repository_id => 10,
:rev => 4,
:issue_id => 9999,
:format => 'js'
......@@ -323,6 +332,7 @@ class RepositoriesControllerTest < Redmine::RepositoryControllerTest
assert_difference 'Changeset.find(103).issues.size', -1 do
delete :remove_related_issue, :params => {
:id => 1,
:repository_id => 10,
:rev => 4,
:issue_id => 2,
:format => 'js'
......@@ -343,6 +353,7 @@ class RepositoriesControllerTest < Redmine::RepositoryControllerTest
get :graph, :params => {
:id => 1,
:repository_id => 10,
:graph => 'commits_per_month'
}
assert_response :success
......@@ -356,6 +367,7 @@ class RepositoriesControllerTest < Redmine::RepositoryControllerTest
def test_graph_commits_per_author
get :graph, :params => {
:id => 1,
:repository_id => 10,
:graph => 'commits_per_author'
}
assert_response :success
......
......@@ -86,6 +86,7 @@ class RepositoriesCvsControllerTest < Redmine::RepositoryControllerTest
assert_equal NUM_REV, @repository.changesets.count
get :show, :params => {
:id => PRJ_ID,
:repository_id => @repository.id,
:path => repository_path_hash(['images'])[:param]
}
assert_response :success
......@@ -105,6 +106,7 @@ class RepositoriesCvsControllerTest < Redmine::RepositoryControllerTest
assert_equal NUM_REV, @repository.changesets.count
get :show, :params => {
:id => PRJ_ID,
:repository_id => @repository.id,
:path => repository_path_hash(['images'])[:param],
:rev => 1
}
......@@ -124,6 +126,7 @@ class RepositoriesCvsControllerTest < Redmine::RepositoryControllerTest
assert_equal NUM_REV, @repository.changesets.count
get :entry, :params => {
:id => PRJ_ID,
:repository_id => @repository.id,
:path => repository_path_hash(['sources', 'watchers_controller.rb'])[:param]
}
assert_response :success
......@@ -139,6 +142,7 @@ class RepositoriesCvsControllerTest < Redmine::RepositoryControllerTest
assert_equal NUM_REV, @repository.changesets.count
get :entry, :params => {
:id => PRJ_ID,
:repository_id => @repository.id,
:path => repository_path_hash(['sources', 'watchers_controller.rb'])[:param],
:rev => 2
}
......@@ -155,7 +159,8 @@ class RepositoriesCvsControllerTest < Redmine::RepositoryControllerTest
assert_equal NUM_REV, @repository.changesets.count
get :entry, :params => {
:id => PRJ_ID,
:path => repository_path_hash(['sources', 'zzz.c'])[:param]
:repository_id => @repository.id,
:path => repository_path_hash(['sources', 'zzz.c'])[:param]
}
assert_select 'p#errorExplanation', :text => /The entry or revision was not found in the repository/
end
......@@ -167,6 +172,7 @@ class RepositoriesCvsControllerTest < Redmine::RepositoryControllerTest
assert_equal NUM_REV, @repository.changesets.count
get :entry, :params => {
:id => PRJ_ID,
:repository_id => @repository.id,
:path => repository_path_hash(['sources', 'watchers_controller.rb'])[:param],
:format => 'raw'
}
......@@ -180,6 +186,7 @@ class RepositoriesCvsControllerTest < Redmine::RepositoryControllerTest
assert_equal NUM_REV, @repository.changesets.count
get :entry, :params => {
:id => PRJ_ID,
:repository_id => @repository.id,
:path => repository_path_hash(['sources'])[:param]
}
assert_response :success
......@@ -194,6 +201,7 @@ class RepositoriesCvsControllerTest < Redmine::RepositoryControllerTest
['inline', 'sbs'].each do |dt|
get :diff, :params => {
:id => PRJ_ID,
:repository_id => @repository.id,
:rev => 3,
:type => dt
}
......@@ -212,6 +220,7 @@ class RepositoriesCvsControllerTest < Redmine::RepositoryControllerTest
['inline', 'sbs'].each do |dt|
get :diff, :params => {
:id => PRJ_ID,
:repository_id => @repository.id,
:rev => 1,
:type => dt
}
......@@ -232,6 +241,7 @@ class RepositoriesCvsControllerTest < Redmine::RepositoryControllerTest
assert_equal NUM_REV, @repository.changesets.count
get :annotate, :params => {
:id => PRJ_ID,
:repository_id => @repository.id,
:path => repository_path_hash(['sources', 'watchers_controller.rb'])[:param]
}
assert_response :success
......
......@@ -79,6 +79,7 @@ class RepositoriesFilesystemControllerTest < Redmine::RepositoryControllerTest
def test_show_no_extension
get :entry, :params => {
:id => PRJ_ID,
:repository_id => @repository.id,
:path => repository_path_hash(['test'])[:param]
}
assert_response :success
......@@ -88,6 +89,7 @@ class RepositoriesFilesystemControllerTest < Redmine::RepositoryControllerTest
def test_entry_download_no_extension
get :raw, :params => {
:id => PRJ_ID,
:repository_id => @repository.id,
:path => repository_path_hash(['test'])[:param]
}
assert_response :success
......@@ -98,6 +100,7 @@ class RepositoriesFilesystemControllerTest < Redmine::RepositoryControllerTest
with_settings :repositories_encodings => 'UTF-8,EUC-JP' do
get :entry, :params => {
:id => PRJ_ID,
:repository_id => @repository.id,
:path => repository_path_hash(['japanese', 'euc-jp.txt'])[:param]
}
assert_response :success
......@@ -118,6 +121,7 @@ class RepositoriesFilesystemControllerTest < Redmine::RepositoryControllerTest
with_settings :repositories_encodings => enc do
get :entry, :params => {
:id => PRJ_ID,
:repository_id => @repository.id,
:path => repository_path_hash(['japanese', 'utf-16.txt'])[:param]
}
assert_response :success
......@@ -129,6 +133,7 @@ class RepositoriesFilesystemControllerTest < Redmine::RepositoryControllerTest
with_settings :file_max_size_displayed => 1 do
get :entry, :params => {
:id => PRJ_ID,
:repository_id => @repository.id,
:path => repository_path_hash(['japanese', 'big-file.txt'])[:param]
}
assert_response :success
......
......@@ -97,6 +97,7 @@ class RepositoriesMercurialControllerTest < Redmine::RepositoryControllerTest
assert_equal NUM_REV, @repository.changesets.count
get :show, :params => {
:id => PRJ_ID,
:repository_id => @repository.id,
:path => repository_path_hash(['images'])[:param]
}
assert_response :success
......@@ -120,6 +121,7 @@ class RepositoriesMercurialControllerTest < Redmine::RepositoryControllerTest
[0, '0', '0885933ad4f6'].each do |r1|
get :show, :params => {
:id => PRJ_ID,
:repository_id => @repository.id,
:path => repository_path_hash(['images'])[:param],
:rev => r1
}
......@@ -144,6 +146,7 @@ class RepositoriesMercurialControllerTest < Redmine::RepositoryControllerTest
[13, '13', '3a330eb32958'].each do |r1|
get :show, :params => {
:id => PRJ_ID,
:repository_id => @repository.id,
:path => repository_path_hash(['sql_escape', 'percent%dir'])[:param],
:rev => r1
}
......@@ -172,6 +175,7 @@ class RepositoriesMercurialControllerTest < Redmine::RepositoryControllerTest
[21, '21', 'adf805632193'].each do |r1|
get :show, :params => {
:id => PRJ_ID,
:repository_id => @repository.id,
:path => repository_path_hash(['latin-1-dir'])[:param],
:rev => r1
}
......@@ -223,6 +227,7 @@ class RepositoriesMercurialControllerTest < Redmine::RepositoryControllerTest
].each do |bra|
get :show, :params => {
:id => PRJ_ID,
:repository_id => @repository.id,
:rev => bra
}
assert_response :success
......@@ -244,6 +249,7 @@ class RepositoriesMercurialControllerTest < Redmine::RepositoryControllerTest
].each do |tag|
get :show, :params => {
:id => PRJ_ID,
:repository_id => @repository.id,
:rev => tag
}
assert_response :success
......@@ -256,6 +262,7 @@ class RepositoriesMercurialControllerTest < Redmine::RepositoryControllerTest
def test_changes
get :changes, :params => {
:id => PRJ_ID,
:repository_id => @repository.id,
:path => repository_path_hash(['images', 'edit.png'])[:param]
}
assert_response :success
......@@ -265,6 +272,7 @@ class RepositoriesMercurialControllerTest < Redmine::RepositoryControllerTest
def test_entry_show
get :entry, :params => {
:id => PRJ_ID,
:repository_id => @repository.id,
:path => repository_path_hash(['sources', 'watchers_controller.rb'])[:param]
}
assert_response :success
......@@ -276,6 +284,7 @@ class RepositoriesMercurialControllerTest < Redmine::RepositoryControllerTest
[21, '21', 'adf805632193'].each do |r1|
get :entry, :params => {
:id => PRJ_ID,
:repository_id => @repository.id,
:path => repository_path_hash(['latin-1-dir', "test-#{@char_1}-2.txt"])[:param],
:rev => r1
}
......@@ -289,6 +298,7 @@ class RepositoriesMercurialControllerTest < Redmine::RepositoryControllerTest
[27, '27', '7bbf4c738e71'].each do |r1|
get :entry, :params => {
:id => PRJ_ID,
:repository_id => @repository.id,
:path => repository_path_hash(['latin-1-dir', "test-#{@char_1}.txt"])[:param],
:rev => r1
}
......@@ -301,6 +311,7 @@ class RepositoriesMercurialControllerTest < Redmine::RepositoryControllerTest
def test_entry_download
get :entry, :params => {
:id => PRJ_ID,
:repository_id => @repository.id,
:path => repository_path_hash(['sources', 'watchers_controller.rb'])[:param],
:format => 'raw'
}
......@@ -316,6 +327,7 @@ class RepositoriesMercurialControllerTest < Redmine::RepositoryControllerTest
def test_directory_entry
get :entry, :params => {
:id => PRJ_ID,
:repository_id => @repository.id,
:path => repository_path_hash(['sources'])[:param]
}
assert_response :success
......@@ -333,6 +345,7 @@ class RepositoriesMercurialControllerTest < Redmine::RepositoryControllerTest
['inline', 'sbs'].each do |dt|
get :diff, :params => {
:id => PRJ_ID,
:repository_id => @repository.id,
:rev => r1,
:type => dt
}
......@@ -356,6 +369,7 @@ class RepositoriesMercurialControllerTest < Redmine::RepositoryControllerTest
['inline', 'sbs'].each do |dt|
get :diff, :params => {
:id => PRJ_ID,
:repository_id => @repository.id,
:rev => r1,
:rev_to => r2,
:type => dt
......@@ -373,6 +387,7 @@ class RepositoriesMercurialControllerTest < Redmine::RepositoryControllerTest
['inline', 'sbs'].each do |dt|
get :diff, :params => {
:id => PRJ_ID,
:repository_id => @repository.id,
:rev => r1,
:type => dt
}
......@@ -389,6 +404,7 @@ class RepositoriesMercurialControllerTest < Redmine::RepositoryControllerTest
def test_diff_should_show_modified_filenames
get :diff, :params => {
:id => PRJ_ID,
:repository_id => @repository.id,
:rev => '400bb8672109',
:type => 'inline'
}
......@@ -399,6 +415,7 @@ class RepositoriesMercurialControllerTest < Redmine::RepositoryControllerTest
def test_diff_should_show_deleted_filenames
get :diff, :params => {
:id => PRJ_ID,
:repository_id => @repository.id,
:rev => 'b3a615152df8',
:type => 'inline'
}
......@@ -409,6 +426,7 @@ class RepositoriesMercurialControllerTest < Redmine::RepositoryControllerTest
def test_annotate
get :annotate, :params => {
:id => PRJ_ID,
:repository_id => @repository.id,
:path => repository_path_hash(['sources', 'watchers_controller.rb'])[:param]
}
assert_response :success
......@@ -429,6 +447,7 @@ class RepositoriesMercurialControllerTest < Redmine::RepositoryControllerTest
assert_equal NUM_REV, @repository.changesets.count
get :annotate, :params => {
:id => PRJ_ID,
:repository_id => @repository.id,
:path => repository_path_hash(['sources', 'welcome_controller.rb'])[:param]
}
assert_response 404
......@@ -443,6 +462,7 @@ class RepositoriesMercurialControllerTest < Redmine::RepositoryControllerTest
[2, '400bb8672109', '400', 400].each do |r1|
get :annotate, :params => {
:id => PRJ_ID,
:repository_id => @repository.id,
:rev => r1,
:path => repository_path_hash(['sources', 'watchers_controller.rb'])[:param]
}
......@@ -455,6 +475,7 @@ class RepositoriesMercurialControllerTest < Redmine::RepositoryControllerTest
[21, '21', 'adf805632193'].each do |r1|
get :annotate, :params => {
:id => PRJ_ID,
:repository_id => @repository.id,
:path => repository_path_hash(['latin-1-dir', "test-#{@char_1}-2.txt"])[:param],
:rev => r1
}
......@@ -476,6 +497,7 @@ class RepositoriesMercurialControllerTest < Redmine::RepositoryControllerTest
[27, '7bbf4c738e71'].each do |r1|
get :annotate, :params => {
:id => PRJ_ID,
:repository_id => @repository.id,
:path => repository_path_hash(['latin-1-dir', "test-#{@char_1}.txt"])[:param],
:rev => r1
}
......@@ -493,6 +515,7 @@ class RepositoriesMercurialControllerTest < Redmine::RepositoryControllerTest
with_settings :default_language => "en" do
get :revision, :params => {
:id => PRJ_ID,
:repository_id => @repository.id,
:rev => r
}
assert_response :success
......@@ -510,6 +533,7 @@ class RepositoriesMercurialControllerTest < Redmine::RepositoryControllerTest
['', ' ', nil].each do |r|
get :revision, :params => {
:id => PRJ_ID,
:repository_id => @repository.id,
:rev => r
}
assert_response 404
......
This diff is collapsed.
......@@ -43,7 +43,7 @@ class RepositoriesGitTest < Redmine::IntegrationTest
end
def test_diff_two_revs
get '/projects/subproject1/repository/diff?rev=61b685fbe&rev_to=2f9c0091'
get "/projects/subproject1/repository/#{@repository.id}/diff?rev=61b685fbe&rev_to=2f9c0091"
assert_response :success
end
end
......
......@@ -20,7 +20,7 @@ require File.expand_path('../../../test_helper', __FILE__)
class RoutingRepositoriesTest < Redmine::RoutingTest
def setup
@paths = ['path/to/file.c', 'path/to/index.html']
@paths = ['path/to/file.c', 'path/to/index.html', 'raw/file.c']
end
def test_repositories_resources
......@@ -37,8 +37,6 @@ class RoutingRepositoriesTest < Redmine::RoutingTest
def test_repositories
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'
end
def test_repositories_with_repository_id
......@@ -47,23 +45,6 @@ class RoutingRepositoriesTest < Redmine::RoutingTest
should_route 'GET /projects/foo/repository/svn/graph' => 'repositories#graph', :id => 'foo', :repository_id => 'svn'
end
def test_repositories_revisions
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', :format => 'html'
should_route 'GET /projects/foo/repository/revisions/2457/diff' => 'repositories#diff', :id => 'foo', :rev => '2457', :format => 'html'
%w(show diff entry raw annotate).each do |action|
@paths.each do |path|
should_route "GET /projects/foo/repository/revisions/2457/#{action}/#{path}" => "repositories##{action}",
:id => 'foo', :rev => '2457', :path => path, :format => 'html'
end
end
end
def test_repositories_revisions_with_repository_id
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'
......@@ -81,17 +62,6 @@ class RoutingRepositoriesTest < Redmine::RoutingTest
end
end
def test_repositories_non_revisions_path
should_route 'GET /projects/foo/repository/changes' => 'repositories#changes', :id => 'foo', :format => 'html'
%w(changes diff browse entry raw annotate).each do |action|
@paths.each do |path|
should_route "GET /projects/foo/repository/#{action}/#{path}" => "repositories##{action}",
:id => 'foo', :path => path, :format => 'html'
end
end
end
def test_repositories_non_revisions_path_with_repository_id
should_route 'GET /projects/foo/repository/svn/changes' => 'repositories#changes', :id => 'foo', :repository_id => 'svn', :format => 'html'
......@@ -103,13 +73,6 @@ class RoutingRepositoriesTest < Redmine::RoutingTest
end
end
def test_repositories_related_issues
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'
end
def test_repositories_related_issues_with_repository_id
should_route 'POST /projects/foo/repository/svn/revisions/123/issues' => 'repositories#add_related_issue',
:id => 'foo', :repository_id => 'svn', :rev => '123'
......
......@@ -62,7 +62,7 @@ class MailerTest < ActiveSupport::TestCase
:text => '#1'
# link to a changeset
assert_select 'a[href=?][title=?]',
'https://mydomain.foo/projects/ecookbook/repository/revisions/2',
'https://mydomain.foo/projects/ecookbook/repository/10/revisions/2',
'This commit fixes #1, #2 and references #1 & #3',
:text => 'r2'
# link to a description diff
......@@ -102,7 +102,7 @@ class MailerTest < ActiveSupport::TestCase
:text => '#1'
# link to a changeset
assert_select 'a[href=?][title=?]',
'http://mydomain.foo/rdm/projects/ecookbook/repository/revisions/2',
'http://mydomain.foo/rdm/projects/ecookbook/repository/10/revisions/2',
'This commit fixes #1, #2 and references #1 & #3',
:text => 'r2'
# link to a description diff
......@@ -172,7 +172,7 @@ class MailerTest < ActiveSupport::TestCase
:text => '#1'
# link to a changeset
assert_select 'a[href=?][title=?]',
'http://mydomain.foo/rdm/projects/ecookbook/repository/revisions/2',
'http://mydomain.foo/rdm/projects/ecookbook/repository/10/revisions/2',
'This commit fixes #1, #2 and references #1 & #3',
:text => 'r2'
# link to a description diff
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment