diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2017-05-31 17:32:34 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2017-05-31 17:32:34 +0000 |
commit | b834e81d7f41121fc6d9bef95ee090f8f466493e (patch) | |
tree | 61fddb6214c64e96fddd504301029bdb382ba439 /test/functional/previews_controller_test.rb | |
parent | 1d4300b674f739d671a8be22d3ea617922f16517 (diff) | |
download | redmine-b834e81d7f41121fc6d9bef95ee090f8f466493e.tar.gz redmine-b834e81d7f41121fc6d9bef95ee090f8f466493e.zip |
Use Rails 5 syntax for functional tests.
git-svn-id: http://svn.redmine.org/redmine/trunk@16585 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/previews_controller_test.rb')
-rw-r--r-- | test/functional/previews_controller_test.rb | 77 |
1 files changed, 61 insertions, 16 deletions
diff --git a/test/functional/previews_controller_test.rb b/test/functional/previews_controller_test.rb index e75a670fe..231d9519d 100644 --- a/test/functional/previews_controller_test.rb +++ b/test/functional/previews_controller_test.rb @@ -30,7 +30,12 @@ class PreviewsControllerTest < Redmine::ControllerTest def test_preview_new_issue @request.session[:user_id] = 2 - post :issue, :project_id => '1', :issue => {:description => 'Foo'} + post :issue, :params => { + :project_id => '1', + :issue => { + :description => 'Foo' + } + } assert_response :success assert_select 'fieldset' do assert_select 'legend', :text => 'Description' @@ -40,8 +45,14 @@ class PreviewsControllerTest < Redmine::ControllerTest def test_preview_issue_notes_with_no_change_to_description @request.session[:user_id] = 2 - post :issue, :project_id => '1', :id => 1, - :issue => {:description => Issue.find(1).description, :notes => 'Foo'} + post :issue, :params => { + :project_id => '1', + :id => 1, + :issue => { + :description => Issue.find(1).description, + :notes => 'Foo' + } + } assert_response :success assert_select 'legend', :text => 'Description', :count => 0 assert_select 'legend', :text => 'Notes' @@ -49,8 +60,14 @@ class PreviewsControllerTest < Redmine::ControllerTest def test_preview_issue_notes_with_change_to_description @request.session[:user_id] = 2 - post :issue, :project_id => '1', :id => 1, - :issue => {:description => 'Changed description', :notes => 'Foo'} + post :issue, :params => { + :project_id => '1', + :id => 1, + :issue => { + :description => 'Changed description', + :notes => 'Foo' + } + } assert_response :success assert_select 'legend', :text => 'Description' assert_select 'legend', :text => 'Notes' @@ -58,7 +75,13 @@ class PreviewsControllerTest < Redmine::ControllerTest def test_preview_journal_notes_for_update @request.session[:user_id] = 2 - post :issue, :project_id => '1', :id => 1, :journal => {:notes => 'Foo'} + post :issue, :params => { + :project_id => '1', + :id => 1, + :journal => { + :notes => 'Foo' + } + } assert_response :success assert_select 'legend', :text => 'Notes' assert_select 'p', :text => 'Foo' @@ -67,32 +90,54 @@ class PreviewsControllerTest < Redmine::ControllerTest def test_preview_issue_notes_should_support_links_to_existing_attachments Attachment.generate!(:container => Issue.find(1), :filename => 'foo.bar') @request.session[:user_id] = 2 - post :issue, :project_id => '1', :id => 1, :issue => {:notes => 'attachment:foo.bar'} + post :issue, :params => { + :project_id => '1', + :id => 1, + :issue => { + :notes => 'attachment:foo.bar' + } + } assert_response :success assert_select 'a.attachment', :text => 'foo.bar' end def test_preview_issue_with_project_changed @request.session[:user_id] = 2 - post :issue, :project_id => '1', :id => 1, :issue => {:notes => 'notes', :project_id => 2} + post :issue, :params => { + :project_id => '1', + :id => 1, + :issue => { + :notes => 'notes', + :project_id => 2 + } + } assert_response :success assert_select 'legend', :text => 'Notes' end def test_preview_new_news - get :news, :project_id => 1, - :news => {:title => '', - :description => 'News description', - :summary => ''} + get :news, :params => { + :project_id => 1, + :news => { + :title => '', + :description => 'News description', + :summary => '' + } + } assert_response :success assert_select 'fieldset.preview', :text => /News description/ end def test_preview_existing_news - get :news, :project_id => 1, :id => 2, - :news => {:title => '', - :description => 'News description', - :summary => ''} + get :news, :params => { + :project_id => 1, + :id => 2, + :news => { + :title => '', + :description => 'News description', + :summary => '' + } + } assert_response :success assert_select 'fieldset.preview', :text => /News description/ end |