From b834e81d7f41121fc6d9bef95ee090f8f466493e Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Wed, 31 May 2017 17:32:34 +0000 Subject: Use Rails 5 syntax for functional tests. git-svn-id: http://svn.redmine.org/redmine/trunk@16585 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- .../functional/repositories_cvs_controller_test.rb | 63 +++++++++++++++++----- 1 file changed, 49 insertions(+), 14 deletions(-) (limited to 'test/functional/repositories_cvs_controller_test.rb') diff --git a/test/functional/repositories_cvs_controller_test.rb b/test/functional/repositories_cvs_controller_test.rb index 6d48812a8..2f22d5f36 100644 --- a/test/functional/repositories_cvs_controller_test.rb +++ b/test/functional/repositories_cvs_controller_test.rb @@ -46,7 +46,10 @@ class RepositoriesCvsControllerTest < Redmine::ControllerTest def test_get_new @request.session[:user_id] = 1 @project.repository.destroy - get :new, :project_id => 'subproject1', :repository_scm => 'Cvs' + get :new, :params => { + :project_id => 'subproject1', + :repository_scm => 'Cvs' + } assert_response :success assert_select 'select[name=?]', 'repository_scm' do @@ -59,7 +62,9 @@ class RepositoriesCvsControllerTest < Redmine::ControllerTest @repository.fetch_changesets @project.reload assert_equal NUM_REV, @repository.changesets.count - get :show, :id => PRJ_ID + get :show, :params => { + :id => PRJ_ID + } assert_response :success assert_select 'table.entries tbody' do @@ -78,7 +83,10 @@ class RepositoriesCvsControllerTest < Redmine::ControllerTest @repository.fetch_changesets @project.reload assert_equal NUM_REV, @repository.changesets.count - get :show, :id => PRJ_ID, :path => repository_path_hash(['images'])[:param] + get :show, :params => { + :id => PRJ_ID, + :path => repository_path_hash(['images'])[:param] + } assert_response :success assert_select 'table.entries tbody' do @@ -94,8 +102,11 @@ class RepositoriesCvsControllerTest < Redmine::ControllerTest @repository.fetch_changesets @project.reload assert_equal NUM_REV, @repository.changesets.count - get :show, :id => PRJ_ID, :path => repository_path_hash(['images'])[:param], + get :show, :params => { + :id => PRJ_ID, + :path => repository_path_hash(['images'])[:param], :rev => 1 + } assert_response :success assert_select 'table.entries tbody' do @@ -110,8 +121,10 @@ class RepositoriesCvsControllerTest < Redmine::ControllerTest @repository.fetch_changesets @project.reload assert_equal NUM_REV, @repository.changesets.count - get :entry, :id => PRJ_ID, + get :entry, :params => { + :id => PRJ_ID, :path => repository_path_hash(['sources', 'watchers_controller.rb'])[:param] + } assert_response :success assert_select 'td.line-code', :text => /before_filter/, :count => 0 @@ -123,9 +136,11 @@ class RepositoriesCvsControllerTest < Redmine::ControllerTest @repository.fetch_changesets @project.reload assert_equal NUM_REV, @repository.changesets.count - get :entry, :id => PRJ_ID, + get :entry, :params => { + :id => PRJ_ID, :path => repository_path_hash(['sources', 'watchers_controller.rb'])[:param], :rev => 2 + } assert_response :success # this line was removed in r3 @@ -137,8 +152,10 @@ class RepositoriesCvsControllerTest < Redmine::ControllerTest @repository.fetch_changesets @project.reload assert_equal NUM_REV, @repository.changesets.count - get :entry, :id => PRJ_ID, + get :entry, :params => { + :id => PRJ_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 @@ -147,9 +164,11 @@ class RepositoriesCvsControllerTest < Redmine::ControllerTest @repository.fetch_changesets @project.reload assert_equal NUM_REV, @repository.changesets.count - get :entry, :id => PRJ_ID, + get :entry, :params => { + :id => PRJ_ID, :path => repository_path_hash(['sources', 'watchers_controller.rb'])[:param], :format => 'raw' + } assert_response :success end @@ -158,8 +177,10 @@ class RepositoriesCvsControllerTest < Redmine::ControllerTest @repository.fetch_changesets @project.reload assert_equal NUM_REV, @repository.changesets.count - get :entry, :id => PRJ_ID, + get :entry, :params => { + :id => PRJ_ID, :path => repository_path_hash(['sources'])[:param] + } assert_response :success assert_select 'table.entries tbody' end @@ -170,7 +191,11 @@ class RepositoriesCvsControllerTest < Redmine::ControllerTest @project.reload assert_equal NUM_REV, @repository.changesets.count ['inline', 'sbs'].each do |dt| - get :diff, :id => PRJ_ID, :rev => 3, :type => dt + get :diff, :params => { + :id => PRJ_ID, + :rev => 3, + :type => dt + } assert_response :success assert_select 'td.line-code.diff_out', :text => /before_filter :require_login/ @@ -184,7 +209,11 @@ class RepositoriesCvsControllerTest < Redmine::ControllerTest @project.reload assert_equal NUM_REV, @repository.changesets.count ['inline', 'sbs'].each do |dt| - get :diff, :id => PRJ_ID, :rev => 1, :type => dt + get :diff, :params => { + :id => PRJ_ID, + :rev => 1, + :type => dt + } assert_response :success assert_select 'td.line-code.diff_in', :text => /watched.remove_watcher/ @@ -200,8 +229,10 @@ class RepositoriesCvsControllerTest < Redmine::ControllerTest @repository.fetch_changesets @project.reload assert_equal NUM_REV, @repository.changesets.count - get :annotate, :id => PRJ_ID, + get :annotate, :params => { + :id => PRJ_ID, :path => repository_path_hash(['sources', 'watchers_controller.rb'])[:param] + } assert_response :success # 1.1 line @@ -226,7 +257,9 @@ class RepositoriesCvsControllerTest < Redmine::ControllerTest assert_equal NUM_REV, @repository.changesets.count assert_difference 'Repository.count', -1 do - delete :destroy, :id => @repository.id + delete :destroy, :params => { + :id => @repository.id + } end assert_response 302 @project.reload @@ -247,7 +280,9 @@ class RepositoriesCvsControllerTest < Redmine::ControllerTest assert_equal 0, @repository.changesets.count assert_difference 'Repository.count', -1 do - delete :destroy, :id => @repository.id + delete :destroy, :params => { + :id => @repository.id + } end assert_response 302 @project.reload -- cgit v1.2.3