diff test/functional/news_controller_test.rb @ 38:33d69fee1d99 cannam

* Merge SVN update from default branch
author Chris Cannam <chris.cannam@soundsoftware.ac.uk>
date Fri, 19 Nov 2010 13:41:40 +0000
parents 94944d00e43c
children af80e5618e9b
line wrap: on
line diff
--- a/test/functional/news_controller_test.rb	Fri Oct 01 15:33:14 2010 +0100
+++ b/test/functional/news_controller_test.rb	Fri Nov 19 13:41:40 2010 +0000
@@ -73,7 +73,7 @@
     post :create, :project_id => 1, :news => { :title => 'NewsControllerTest',
                                             :description => 'This is the description',
                                             :summary => '' }
-    assert_redirected_to 'projects/ecookbook/news'
+    assert_redirected_to '/projects/ecookbook/news'
     
     news = News.find_by_title('NewsControllerTest')
     assert_not_nil news
@@ -93,7 +93,7 @@
   def test_put_update
     @request.session[:user_id] = 2
     put :update, :id => 1, :news => { :description => 'Description changed by test_post_edit' }
-    assert_redirected_to 'news/1'
+    assert_redirected_to '/news/1'
     news = News.find(1)
     assert_equal 'Description changed by test_post_edit', news.description
   end
@@ -113,19 +113,8 @@
   
   def test_destroy
     @request.session[:user_id] = 2
-    post :destroy, :id => 1
-    assert_redirected_to 'projects/ecookbook/news'
+    delete :destroy, :id => 1
+    assert_redirected_to '/projects/ecookbook/news'
     assert_nil News.find_by_id(1)
   end
-  
-  def test_preview
-    get :preview, :project_id => 1,
-                  :news => {:title => '',
-                            :description => 'News description',
-                            :summary => ''}
-    assert_response :success
-    assert_template 'common/_preview'
-    assert_tag :tag => 'fieldset', :attributes => { :class => 'preview' },
-                                   :content => /News description/
-  end
 end