diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2018-09-26 07:27:30 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2018-09-26 07:27:30 +0000 |
commit | b9fa262165601a3b348d22ca1d8da53bda99e55b (patch) | |
tree | 21bd632e051addfee01ab7a568b01f5b6428051a /test/functional/previews_controller_test.rb | |
parent | c171797673f549e434dd6b94f7262fd31a77b533 (diff) | |
download | redmine-b9fa262165601a3b348d22ca1d8da53bda99e55b.tar.gz redmine-b9fa262165601a3b348d22ca1d8da53bda99e55b.zip |
Adds preview option to the wiki toolbar (#27758).
Patch by Marius BALTEANU.
git-svn-id: http://svn.redmine.org/redmine/trunk@17521 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/previews_controller_test.rb')
-rw-r--r-- | test/functional/previews_controller_test.rb | 81 |
1 files changed, 16 insertions, 65 deletions
diff --git a/test/functional/previews_controller_test.rb b/test/functional/previews_controller_test.rb index 65fb9ae77..5512cff2d 100644 --- a/test/functional/previews_controller_test.rb +++ b/test/functional/previews_controller_test.rb @@ -28,62 +28,36 @@ class PreviewsControllerTest < Redmine::ControllerTest :journals, :journal_details, :news - def test_preview_new_issue + def test_preview_new_issue_description @request.session[:user_id] = 2 post :issue, :params => { :project_id => '1', - :issue => { - :description => 'Foo' - } + :text => 'Foo' } assert_response :success - assert_select 'fieldset' do - assert_select 'legend', :text => 'Description' - assert_select 'p', :text => 'Foo' - end + assert_select 'p', :text => 'Foo' end - def test_preview_issue_notes_with_no_change_to_description + def test_preview_issue_description @request.session[:user_id] = 2 post :issue, :params => { :project_id => '1', - :id => 1, - :issue => { - :description => Issue.find(1).description, - :notes => 'Foo' - } + :issue_id => 1, + :text => 'Unable to print recipes' } assert_response :success - assert_select 'legend', :text => 'Description', :count => 0 - assert_select 'legend', :text => 'Notes' - end - def test_preview_issue_notes_with_change_to_description - @request.session[:user_id] = 2 - 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' + assert_select 'p', :text => 'Unable to print recipes' end - def test_preview_journal_notes_for_update + def test_preview_issue_notes @request.session[:user_id] = 2 post :issue, :params => { :project_id => '1', :id => 1, - :journal => { - :notes => 'Foo' - } + :text => 'Foo' } assert_response :success - assert_select 'legend', :text => 'Notes' assert_select 'p', :text => 'Foo' end @@ -92,53 +66,30 @@ class PreviewsControllerTest < Redmine::ControllerTest @request.session[:user_id] = 2 post :issue, :params => { :project_id => '1', - :id => 1, - :issue => { - :notes => 'attachment:foo.bar' - } + :issue_id => 1, + :field => 'notes', + :text => '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, :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, :params => { :project_id => 1, - :news => { - :title => '', - :description => 'News description', - :summary => '' - } + :text => 'News description', } assert_response :success - assert_select 'fieldset.preview', :text => /News description/ + assert_select 'p', :text => /News description/ end def test_preview_existing_news get :news, :params => { :project_id => 1, :id => 2, - :news => { - :title => '', - :description => 'News description', - :summary => '' - } + :text => 'News description' } assert_response :success - assert_select 'fieldset.preview', :text => /News description/ + assert_select 'p', :text => /News description/ end end |