summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-09-16 14:18:43 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-09-16 14:18:43 +0000
commitca4f2c59b6479ad088aa87e6173bcdd5c7c66629 (patch)
treef3ccfc188a24479cb036057315553a2787ce21a5 /test
parent2058c66d734c586ef175c6d2f468bbfeae77e5b8 (diff)
downloadredmine-ca4f2c59b6479ad088aa87e6173bcdd5c7c66629.tar.gz
redmine-ca4f2c59b6479ad088aa87e6173bcdd5c7c66629.zip
Attachments should be available to the text formatter when previewing an existing news.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10400 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/functional/previews_controller_test.rb19
1 files changed, 17 insertions, 2 deletions
diff --git a/test/functional/previews_controller_test.rb b/test/functional/previews_controller_test.rb
index e788b1504..67264e76b 100644
--- a/test/functional/previews_controller_test.rb
+++ b/test/functional/previews_controller_test.rb
@@ -26,7 +26,8 @@ class PreviewsControllerTest < ActionController::TestCase
:members,
:enabled_modules,
:workflows,
- :journals, :journal_details
+ :journals, :journal_details,
+ :news
def test_preview_new_issue
@request.session[:user_id] = 2
@@ -55,7 +56,7 @@ class PreviewsControllerTest < ActionController::TestCase
assert_tag :p, :content => 'Foo'
end
- def test_news
+ def test_preview_new_news
get :news, :project_id => 1,
:news => {:title => '',
:description => 'News description',
@@ -65,4 +66,18 @@ class PreviewsControllerTest < ActionController::TestCase
assert_tag :tag => 'fieldset', :attributes => { :class => 'preview' },
:content => /News description/
end
+
+ def test_existing_new_news
+ get :news, :project_id => 1, :id => 2,
+ :news => {:title => '',
+ :description => 'News description',
+ :summary => ''}
+ assert_response :success
+ assert_template 'common/_preview'
+ assert_equal News.find(2), assigns(:previewed)
+ assert_not_nil assigns(:attachments)
+
+ assert_tag :tag => 'fieldset', :attributes => { :class => 'preview' },
+ :content => /News description/
+ end
end