diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2018-06-16 14:27:51 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2018-06-16 14:27:51 +0000 |
commit | 4137ba8e816c9e8c1782181e5bf1cb0d0ad09d75 (patch) | |
tree | d0e69f33679828abe1402d260a5c41938a9d44f8 /test/functional | |
parent | 794a2a0180ed2d2801be4146ac59799747683b3d (diff) | |
download | redmine-4137ba8e816c9e8c1782181e5bf1cb0d0ad09d75.tar.gz redmine-4137ba8e816c9e8c1782181e5bf1cb0d0ad09d75.zip |
Removes repository routes without repository_id (#26522).
git-svn-id: http://svn.redmine.org/redmine/trunk@17386 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional')
8 files changed, 124 insertions, 16 deletions
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index 9f79908eb..61b2ded0c 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -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 diff --git a/test/functional/repositories_bazaar_controller_test.rb b/test/functional/repositories_bazaar_controller_test.rb index ee9021abd..33b506444 100644 --- a/test/functional/repositories_bazaar_controller_test.rb +++ b/test/functional/repositories_bazaar_controller_test.rb @@ -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 diff --git a/test/functional/repositories_controller_test.rb b/test/functional/repositories_controller_test.rb index e76a2f8c4..8338b8987 100644 --- a/test/functional/repositories_controller_test.rb +++ b/test/functional/repositories_controller_test.rb @@ -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 diff --git a/test/functional/repositories_cvs_controller_test.rb b/test/functional/repositories_cvs_controller_test.rb index c9f26719a..d2b12386d 100644 --- a/test/functional/repositories_cvs_controller_test.rb +++ b/test/functional/repositories_cvs_controller_test.rb @@ -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 diff --git a/test/functional/repositories_filesystem_controller_test.rb b/test/functional/repositories_filesystem_controller_test.rb index 1dd133c58..38e0f8ba9 100644 --- a/test/functional/repositories_filesystem_controller_test.rb +++ b/test/functional/repositories_filesystem_controller_test.rb @@ -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 diff --git a/test/functional/repositories_git_controller_test.rb b/test/functional/repositories_git_controller_test.rb index f1261fa5c..5b9a02956 100644 --- a/test/functional/repositories_git_controller_test.rb +++ b/test/functional/repositories_git_controller_test.rb @@ -145,6 +145,7 @@ class RepositoriesGitControllerTest < Redmine::RepositoryControllerTest assert_equal NUM_REV, @repository.changesets.count get :show, :params => { :id => PRJ_ID, + :repository_id => @repository.id, :rev => 'test_branch' } assert_response :success @@ -173,6 +174,7 @@ class RepositoriesGitControllerTest < Redmine::RepositoryControllerTest ].each do |t1| get :show, :params => { :id => PRJ_ID, + :repository_id => @repository.id, :rev => t1 } assert_response :success @@ -189,6 +191,7 @@ class RepositoriesGitControllerTest < 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 @@ -207,6 +210,7 @@ class RepositoriesGitControllerTest < 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 => '7234cb2750b63f47bff735edc50a1c0a433c2518' } @@ -221,6 +225,7 @@ class RepositoriesGitControllerTest < 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 @@ -230,6 +235,7 @@ class RepositoriesGitControllerTest < 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 @@ -249,6 +255,7 @@ class RepositoriesGitControllerTest < Redmine::RepositoryControllerTest ['57ca437c', '57ca437c0acbbcb749821fdf3726a1367056d364'].each do |r1| get :entry, :params => { :id => PRJ_ID, + :repository_id => @repository.id, :path => repository_path_hash(['latin-1-dir', "test-#{CHAR_1_HEX}.txt"])[:param], :rev => r1 } @@ -262,6 +269,7 @@ class RepositoriesGitControllerTest < 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' } @@ -273,6 +281,7 @@ class RepositoriesGitControllerTest < 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 @@ -293,6 +302,7 @@ class RepositoriesGitControllerTest < Redmine::RepositoryControllerTest ['inline', 'sbs'].each do |dt| get :diff, :params => { :id => PRJ_ID, + :repository_id => @repository.id, :rev => '2f9c0091c754a91af7a9c478e36556b4bde8dcf7', :type => dt } @@ -313,6 +323,7 @@ class RepositoriesGitControllerTest < Redmine::RepositoryControllerTest ['inline', 'sbs'].each do |dt| get :diff, :params => { :id => PRJ_ID, + :repository_id => @repository.id, :rev => '2f9c0091c754a91af7a9c478e36556b4bde8dcf7', :path => repository_path_hash(['sources', 'watchers_controller.rb'])[:param], :type => dt @@ -337,6 +348,7 @@ class RepositoriesGitControllerTest < Redmine::RepositoryControllerTest with_settings :default_language => 'en' do get :diff, :params => { :id => PRJ_ID, + :repository_id => @repository.id, :type => 'inline', :rev => '2f9c0091c754a91af7a9c478e36556b4bde8dcf7' } @@ -346,6 +358,7 @@ class RepositoriesGitControllerTest < Redmine::RepositoryControllerTest with_settings :default_language => 'fr' do get :diff, :params => { :id => PRJ_ID, + :repository_id => @repository.id, :type => 'inline', :rev => '2f9c0091c754a91af7a9c478e36556b4bde8dcf7' } @@ -365,13 +378,14 @@ class RepositoriesGitControllerTest < Redmine::RepositoryControllerTest ['inline', 'sbs'].each do |dt| get :diff, :params => { :id => PRJ_ID, + :repository_id => @repository.id, :rev => '61b685fbe55ab05b5ac68402d5720c1a6ac973d1', :rev_to => '2f9c0091c754a91af7a9c478e36556b4bde8dcf7', :type => dt } assert_response :success assert_select 'h2', :text => /2f9c0091:61b685fb/ - assert_select 'form[action=?]', '/projects/subproject1/repository/revisions/61b685fbe55ab05b5ac68402d5720c1a6ac973d1/diff' + assert_select 'form[action=?]', "/projects/subproject1/repository/#{@repository.id}/revisions/61b685fbe55ab05b5ac68402d5720c1a6ac973d1/diff" assert_select 'input#rev_to[type=hidden][name=rev_to][value=?]', '2f9c0091c754a91af7a9c478e36556b4bde8dcf7' end end @@ -407,6 +421,7 @@ class RepositoriesGitControllerTest < Redmine::RepositoryControllerTest ['inline', 'sbs'].each do |dt| get :diff, :params => { :id => PRJ_ID, + :repository_id => @repository.id, :rev => r1, :type => dt } @@ -424,6 +439,7 @@ class RepositoriesGitControllerTest < Redmine::RepositoryControllerTest def test_diff_should_show_filenames get :diff, :params => { :id => PRJ_ID, + :repository_id => @repository.id, :rev => 'deff712f05a90d96edbd70facc47d944be5897e3', :type => 'inline' } @@ -444,6 +460,7 @@ class RepositoriesGitControllerTest < Redmine::RepositoryControllerTest @request.session[:user_id] = 1 # admin get :diff, :params => { :id => PRJ_ID, + :repository_id => @repository.id, :rev => '2f9c0091c754a91af7a9c478e36556b4bde8dcf7' } assert_response :success @@ -451,6 +468,7 @@ class RepositoriesGitControllerTest < Redmine::RepositoryControllerTest assert_equal "inline", user.pref[:diff_type] get :diff, :params => { :id => PRJ_ID, + :repository_id => @repository.id, :rev => '2f9c0091c754a91af7a9c478e36556b4bde8dcf7', :type => 'sbs' } @@ -462,6 +480,7 @@ class RepositoriesGitControllerTest < 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 @@ -482,6 +501,7 @@ class RepositoriesGitControllerTest < Redmine::RepositoryControllerTest assert_equal NUM_REV, @repository.changesets.count get :annotate, :params => { :id => PRJ_ID, + :repository_id => @repository.id, :rev => 'deff7', :path => repository_path_hash(['sources', 'watchers_controller.rb'])[:param] } @@ -493,6 +513,7 @@ class RepositoriesGitControllerTest < Redmine::RepositoryControllerTest with_settings :default_language => 'en' do get :annotate, :params => { :id => PRJ_ID, + :repository_id => @repository.id, :path => repository_path_hash(['images', 'edit.png'])[:param] } assert_response :success @@ -504,6 +525,7 @@ class RepositoriesGitControllerTest < Redmine::RepositoryControllerTest with_settings :file_max_size_displayed => 1 do get :annotate, :params => { :id => PRJ_ID, + :repository_id => @repository.id, :path => repository_path_hash(['sources', 'watchers_controller.rb'])[:param], :rev => 'deff712f' } @@ -512,6 +534,7 @@ class RepositoriesGitControllerTest < Redmine::RepositoryControllerTest get :annotate, :params => { :id => PRJ_ID, + :repository_id => @repository.id, :path => repository_path_hash(['README'])[:param], :rev => '7234cb2' } @@ -531,6 +554,7 @@ class RepositoriesGitControllerTest < Redmine::RepositoryControllerTest ['57ca437c', '57ca437c0acbbcb749821fdf3726a1367056d364'].each do |r1| get :annotate, :params => { :id => PRJ_ID, + :repository_id => @repository.id, :path => repository_path_hash(['latin-1-dir', "test-#{CHAR_1_HEX}.txt"])[:param], :rev => r1 } @@ -552,6 +576,7 @@ class RepositoriesGitControllerTest < Redmine::RepositoryControllerTest ['83ca5fd546063a3c7dc2e568ba3355661a9e2b2c', '83ca5fd546063a'].each do |r1| get :annotate, :params => { :id => PRJ_ID, + :repository_id => @repository.id, :path => repository_path_hash([" filename with a leading space.txt "])[:param], :rev => r1 } @@ -573,9 +598,10 @@ class RepositoriesGitControllerTest < Redmine::RepositoryControllerTest @project.reload assert_equal NUM_REV, @repository.changesets.count get :revisions, :params => { - :id => PRJ_ID + :id => PRJ_ID, + :repository_id => @repository.id } - assert_select 'form[method=get][action=?]', '/projects/subproject1/repository/revision' + assert_select 'form[method=get][action=?]', "/projects/subproject1/repository/#{@repository.id}/revision" end def test_revision @@ -586,6 +612,7 @@ class RepositoriesGitControllerTest < Redmine::RepositoryControllerTest ['61b685fbe55ab05b5ac68402d5720c1a6ac973d1', '61b685f'].each do |r| get :revision, :params => { :id => PRJ_ID, + :repository_id => @repository.id, :rev => r } assert_response :success @@ -600,6 +627,7 @@ class RepositoriesGitControllerTest < Redmine::RepositoryControllerTest ['', ' ', nil].each do |r| get :revision, :params => { :id => PRJ_ID, + :repository_id => @repository.id, :rev => r } assert_response 404 diff --git a/test/functional/repositories_mercurial_controller_test.rb b/test/functional/repositories_mercurial_controller_test.rb index d24b5bcbc..f7ba7038b 100644 --- a/test/functional/repositories_mercurial_controller_test.rb +++ b/test/functional/repositories_mercurial_controller_test.rb @@ -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 diff --git a/test/functional/repositories_subversion_controller_test.rb b/test/functional/repositories_subversion_controller_test.rb index f8f4b8f9d..e9de476a4 100644 --- a/test/functional/repositories_subversion_controller_test.rb +++ b/test/functional/repositories_subversion_controller_test.rb @@ -65,7 +65,7 @@ class RepositoriesSubversionControllerTest < Redmine::RepositoryControllerTest assert_select 'table.entries tbody' do assert_select 'tr', 1 assert_select 'tr.dir td.filename a', :text => 'subversion_test' - assert_select 'tr.dir td.filename a[href=?]', '/projects/subproject1/repository/show/subversion_test' + assert_select 'tr.dir td.filename a[href=?]', "/projects/subproject1/repository/#{@repository.id}/show/subversion_test" end assert_select 'table.changesets tbody' do @@ -76,7 +76,7 @@ class RepositoriesSubversionControllerTest < Redmine::RepositoryControllerTest assert_select 'input[name=rev]' assert_select 'a', :text => 'Statistics' assert_select 'a', :text => 'Atom' - assert_select 'a[href=?]', '/projects/subproject1/repository', :text => 'root' + assert_select 'a[href=?]', "/projects/subproject1/repository/#{@repository.id}", :text => 'root' end def test_show_non_default @@ -102,6 +102,7 @@ class RepositoriesSubversionControllerTest < Redmine::RepositoryControllerTest assert_equal NUM_REV, @repository.changesets.count get :show, :params => { :id => PRJ_ID, + :repository_id => @repository.id, :path => repository_path_hash(['subversion_test'])[:param] } assert_response :success @@ -125,6 +126,7 @@ class RepositoriesSubversionControllerTest < Redmine::RepositoryControllerTest assert_equal NUM_REV, @repository.changesets.count get :show, :params => { :id => PRJ_ID, + :repository_id => @repository.id, :path => repository_path_hash(['subversion_test'])[:param], :rev => 4 } @@ -147,6 +149,7 @@ class RepositoriesSubversionControllerTest < Redmine::RepositoryControllerTest assert_equal NUM_REV, @repository.changesets.count get :changes, :params => { :id => PRJ_ID, + :repository_id => @repository.id, :path => repository_path_hash(['subversion_test', 'folder', 'helloworld.rb'])[:param] } assert_response :success @@ -174,6 +177,7 @@ class RepositoriesSubversionControllerTest < Redmine::RepositoryControllerTest assert_equal NUM_REV, @repository.changesets.count get :changes, :params => { :id => PRJ_ID, + :repository_id => @repository.id, :path => repository_path_hash(['subversion_test', 'folder'])[:param] } assert_response :success @@ -196,6 +200,7 @@ class RepositoriesSubversionControllerTest < Redmine::RepositoryControllerTest assert_equal NUM_REV, @repository.changesets.count get :entry, :params => { :id => PRJ_ID, + :repository_id => @repository.id, :path => repository_path_hash(['subversion_test', 'helloworld.c'])[:param] } assert_response :success @@ -212,6 +217,7 @@ class RepositoriesSubversionControllerTest < Redmine::RepositoryControllerTest with_settings :file_max_size_displayed => 0 do get :entry, :params => { :id => PRJ_ID, + :repository_id => @repository.id, :path => repository_path_hash(['subversion_test', 'helloworld.c'])[:param] } assert_response :success @@ -223,10 +229,11 @@ class RepositoriesSubversionControllerTest < Redmine::RepositoryControllerTest def test_entry_should_display_images get :entry, :params => { :id => PRJ_ID, + :repository_id => @repository.id, :path => repository_path_hash(['subversion_test', 'folder', 'subfolder', 'rubylogo.gif'])[:param] } assert_response :success - assert_select 'img[src=?]', '/projects/subproject1/repository/raw/subversion_test/folder/subfolder/rubylogo.gif' + assert_select 'img[src=?]', "/projects/subproject1/repository/#{@repository.id}/raw/subversion_test/folder/subfolder/rubylogo.gif" end def test_entry_at_given_revision @@ -236,6 +243,7 @@ class RepositoriesSubversionControllerTest < Redmine::RepositoryControllerTest assert_equal NUM_REV, @repository.changesets.count get :entry, :params => { :id => PRJ_ID, + :repository_id => @repository.id, :path => repository_path_hash(['subversion_test', 'helloworld.rb'])[:param], :rev => 2 } @@ -251,6 +259,7 @@ class RepositoriesSubversionControllerTest < Redmine::RepositoryControllerTest assert_equal NUM_REV, @repository.changesets.count get :entry, :params => { :id => PRJ_ID, + :repository_id => @repository.id, :path => repository_path_hash(['subversion_test', 'zzz.c'])[:param] } assert_select 'p#errorExplanation', :text => /The entry or revision was not found in the repository/ @@ -263,6 +272,7 @@ class RepositoriesSubversionControllerTest < Redmine::RepositoryControllerTest assert_equal NUM_REV, @repository.changesets.count get :raw, :params => { :id => PRJ_ID, + :repository_id => @repository.id, :path => repository_path_hash(['subversion_test', 'helloworld.c'])[:param] } assert_response :success @@ -276,6 +286,7 @@ class RepositoriesSubversionControllerTest < Redmine::RepositoryControllerTest assert_equal NUM_REV, @repository.changesets.count get :entry, :params => { :id => PRJ_ID, + :repository_id => @repository.id, :path => repository_path_hash(['subversion_test', 'folder'])[:param] } assert_response :success @@ -287,6 +298,7 @@ class RepositoriesSubversionControllerTest < Redmine::RepositoryControllerTest def test_revision get :revision, :params => { :id => 1, + :repository_id => 10, :rev => 2 } assert_response :success @@ -294,9 +306,9 @@ class RepositoriesSubversionControllerTest < Redmine::RepositoryControllerTest assert_select 'ul' do assert_select 'li' do # link to the entry at rev 2 - assert_select 'a[href=?]', '/projects/ecookbook/repository/revisions/2/entry/test/some/path/in/the/repo', :text => 'repo' + assert_select 'a[href=?]', '/projects/ecookbook/repository/10/revisions/2/entry/test/some/path/in/the/repo', :text => 'repo' # link to partial diff - assert_select 'a[href=?]', '/projects/ecookbook/repository/revisions/2/diff/test/some/path/in/the/repo' + assert_select 'a[href=?]', '/projects/ecookbook/repository/10/revisions/2/diff/test/some/path/in/the/repo' end end end @@ -308,6 +320,7 @@ class RepositoriesSubversionControllerTest < Redmine::RepositoryControllerTest assert_equal NUM_REV, @repository.changesets.count get :revision, :params => { :id => PRJ_ID, + :repository_id => @repository.id, :rev => 'something_weird' } assert_response 404 @@ -317,6 +330,7 @@ class RepositoriesSubversionControllerTest < Redmine::RepositoryControllerTest def test_invalid_revision_diff get :diff, :params => { :id => PRJ_ID, + :repository_id => @repository.id, :rev => '1', :rev_to => 'something_weird' } @@ -332,6 +346,7 @@ class RepositoriesSubversionControllerTest < Redmine::RepositoryControllerTest ['', ' ', nil].each do |r| get :revision, :params => { :id => PRJ_ID, + :repository_id => @repository.id, :rev => r } assert_response 404 @@ -347,6 +362,7 @@ class RepositoriesSubversionControllerTest < Redmine::RepositoryControllerTest get :revision, :params => { :id => 1, + :repository_id => 10, :rev => 2 } assert_response :success @@ -354,9 +370,9 @@ class RepositoriesSubversionControllerTest < Redmine::RepositoryControllerTest assert_select 'ul' do assert_select 'li' do # link to the entry at rev 2 - assert_select 'a[href=?]', '/projects/ecookbook/repository/revisions/2/entry/path/in/the/repo', :text => 'repo' + assert_select 'a[href=?]', '/projects/ecookbook/repository/10/revisions/2/entry/path/in/the/repo', :text => 'repo' # link to partial diff - assert_select 'a[href=?]', '/projects/ecookbook/repository/revisions/2/diff/path/in/the/repo' + assert_select 'a[href=?]', '/projects/ecookbook/repository/10/revisions/2/diff/path/in/the/repo' end end end @@ -369,6 +385,7 @@ class RepositoriesSubversionControllerTest < Redmine::RepositoryControllerTest ['inline', 'sbs'].each do |dt| get :diff, :params => { :id => PRJ_ID, + :repository_id => @repository.id, :rev => 3, :type => dt } @@ -386,6 +403,7 @@ class RepositoriesSubversionControllerTest < Redmine::RepositoryControllerTest get :diff, :params => { :id => PRJ_ID, + :repository_id => @repository.id, :rev => 5, :format => 'diff' } @@ -402,6 +420,7 @@ class RepositoriesSubversionControllerTest < Redmine::RepositoryControllerTest ['inline', 'sbs'].each do |dt| get :diff, :params => { :id => PRJ_ID, + :repository_id => @repository.id, :rev => 6, :rev_to => 2, :path => repository_path_hash(['subversion_test', 'folder'])[:param], @@ -424,6 +443,7 @@ class RepositoriesSubversionControllerTest < Redmine::RepositoryControllerTest assert_equal NUM_REV, @repository.changesets.count get :annotate, :params => { :id => PRJ_ID, + :repository_id => @repository.id, :path => repository_path_hash(['subversion_test', 'helloworld.c'])[:param] } assert_response :success @@ -449,6 +469,7 @@ class RepositoriesSubversionControllerTest < Redmine::RepositoryControllerTest assert_equal NUM_REV, @repository.changesets.count get :annotate, :params => { :id => PRJ_ID, + :repository_id => @repository.id, :rev => 8, :path => repository_path_hash(['subversion_test', 'helloworld.c'])[:param] } |