summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2017-04-13 12:15:21 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2017-04-13 12:15:21 +0000
commit35bb707b918d58e23d9a784a9226cade5304a08d (patch)
tree16ec8ae85dc862614df453a1d6182643cff56ba8 /test
parent4d5ddb007262c4c85c5086040e9a09fc0d0f5374 (diff)
downloadredmine-35bb707b918d58e23d9a784a9226cade5304a08d.tar.gz
redmine-35bb707b918d58e23d9a784a9226cade5304a08d.zip
Preview when editing journal notes broken by r15621.
git-svn-id: http://svn.redmine.org/redmine/trunk@16542 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/functional/previews_controller_test.rb6
-rw-r--r--test/ui/issues_test_ui.rb22
2 files changed, 25 insertions, 3 deletions
diff --git a/test/functional/previews_controller_test.rb b/test/functional/previews_controller_test.rb
index ac9090de9..e75a670fe 100644
--- a/test/functional/previews_controller_test.rb
+++ b/test/functional/previews_controller_test.rb
@@ -47,7 +47,7 @@ class PreviewsControllerTest < Redmine::ControllerTest
assert_select 'legend', :text => 'Notes'
end
- def test_preview_issue_notes_with_no_change_to_description
+ 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'}
@@ -58,7 +58,7 @@ class PreviewsControllerTest < Redmine::ControllerTest
def test_preview_journal_notes_for_update
@request.session[:user_id] = 2
- post :issue, :project_id => '1', :id => 1, :notes => 'Foo'
+ post :issue, :project_id => '1', :id => 1, :journal => {:notes => 'Foo'}
assert_response :success
assert_select 'legend', :text => 'Notes'
assert_select 'p', :text => 'Foo'
@@ -67,7 +67,7 @@ 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, :notes => 'attachment:foo.bar'
+ post :issue, :project_id => '1', :id => 1, :issue => {:notes => 'attachment:foo.bar'}
assert_response :success
assert_select 'a.attachment', :text => 'foo.bar'
end
diff --git a/test/ui/issues_test_ui.rb b/test/ui/issues_test_ui.rb
index e19497edc..c0739175d 100644
--- a/test/ui/issues_test_ui.rb
+++ b/test/ui/issues_test_ui.rb
@@ -310,4 +310,26 @@ class Redmine::UiTest::IssuesTest < Redmine::UiTest::Base
assert !page.has_css?('span.total-for-estimated-hours')
end
end
+
+ def test_update_journal_notes_with_preview
+ log_user('admin', 'admin')
+
+ visit '/issues/1'
+ # Click on the edit button
+ page.first('#change-2 a.icon-edit').click
+ # Check that the textarea is displayed
+ assert page.has_css?('#change-2 textarea')
+ assert page.first('#change-2 textarea').has_content?('Some notes with Redmine links')
+ # Update the notes
+ fill_in 'Notes', :with => 'Updated notes'
+ # Preview the change
+ click_on 'Preview'
+ assert page.has_css?('#journal_2_preview')
+ assert page.first('#journal_2_preview').has_content?('Updated notes')
+ # Save
+ click_on 'Save'
+
+ sleep 1
+ assert_equal 'Updated notes', Journal.find(2).notes
+ end
end