From 966f238da459fda40be8db48904dad7e4266a443 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Thu, 1 Jun 2017 18:17:27 +0000 Subject: Use Rails 5 syntax for integration tests. git-svn-id: http://svn.redmine.org/redmine/trunk@16586 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- .../lib/redmine/field_format/attachment_format_test.rb | 12 ++++++------ test/integration/lib/redmine/hook_test.rb | 2 +- test/integration/lib/redmine/menu_manager_test.rb | 3 ++- 3 files changed, 9 insertions(+), 8 deletions(-) (limited to 'test/integration/lib') diff --git a/test/integration/lib/redmine/field_format/attachment_format_test.rb b/test/integration/lib/redmine/field_format/attachment_format_test.rb index 98aa00548..d0debbb9f 100644 --- a/test/integration/lib/redmine/field_format/attachment_format_test.rb +++ b/test/integration/lib/redmine/field_format/attachment_format_test.rb @@ -51,7 +51,7 @@ class AttachmentFieldFormatTest < Redmine::IntegrationTest def test_create_with_attachment issue = new_record(Issue) do assert_difference 'Attachment.count' do - post '/projects/ecookbook/issues', { + post '/projects/ecookbook/issues', :params => { :issue => { :subject => "Subject", :custom_field_values => { @@ -91,7 +91,7 @@ class AttachmentFieldFormatTest < Redmine::IntegrationTest def test_create_without_attachment issue = new_record(Issue) do assert_no_difference 'Attachment.count' do - post '/projects/ecookbook/issues', { + post '/projects/ecookbook/issues', :params => { :issue => { :subject => "Subject", :custom_field_values => { @@ -117,7 +117,7 @@ class AttachmentFieldFormatTest < Redmine::IntegrationTest def test_failure_on_create_should_preserve_attachment attachment = new_record(Attachment) do assert_no_difference 'Issue.count' do - post '/projects/ecookbook/issues', { + post '/projects/ecookbook/issues', :params => { :issue => { :subject => "", :custom_field_values => { @@ -136,7 +136,7 @@ class AttachmentFieldFormatTest < Redmine::IntegrationTest issue = new_record(Issue) do assert_no_difference 'Attachment.count' do - post '/projects/ecookbook/issues', { + post '/projects/ecookbook/issues', :params => { :issue => { :subject => "Subject", :custom_field_values => { @@ -160,7 +160,7 @@ class AttachmentFieldFormatTest < Redmine::IntegrationTest attachment = new_record(Attachment) do assert_difference 'Issue.count' do - post '/projects/ecookbook/issues', { + post '/projects/ecookbook/issues', :params => { :issue => { :subject => "Blank", :custom_field_values => { @@ -179,7 +179,7 @@ class AttachmentFieldFormatTest < Redmine::IntegrationTest attachment = new_record(Attachment) do assert_no_difference 'Issue.count' do - post '/projects/ecookbook/issues', { + post '/projects/ecookbook/issues', :params => { :issue => { :subject => "Blank", :custom_field_values => { diff --git a/test/integration/lib/redmine/hook_test.rb b/test/integration/lib/redmine/hook_test.rb index 648decf53..f2d44d05d 100644 --- a/test/integration/lib/redmine/hook_test.rb +++ b/test/integration/lib/redmine/hook_test.rb @@ -107,7 +107,7 @@ VIEW def test_controller_hook_context_should_include_request Redmine::Hook.add_listener(ContextTestHook) - post '/login', :username => 'admin', :password => 'admin' + post '/login', :params => {:username => 'admin', :password => 'admin'} assert_not_nil ContextTestHook.context context = ContextTestHook.context assert_kind_of ActionDispatch::Request, context[:request] diff --git a/test/integration/lib/redmine/menu_manager_test.rb b/test/integration/lib/redmine/menu_manager_test.rb index 26d8680e8..fb4a64e38 100644 --- a/test/integration/lib/redmine/menu_manager_test.rb +++ b/test/integration/lib/redmine/menu_manager_test.rb @@ -29,7 +29,8 @@ class MenuManagerTest < Redmine::IntegrationTest :enabled_modules def test_project_menu_with_specific_locale - get '/projects/ecookbook/issues', { }, 'HTTP_ACCEPT_LANGUAGE' => 'fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3' + get '/projects/ecookbook/issues', + :headers => {'HTTP_ACCEPT_LANGUAGE' => 'fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3'} assert_select 'div#main-menu' do assert_select 'li a.activity[href=?]', '/projects/ecookbook/activity', :text => ll('fr', :label_activity) -- cgit v1.2.3