Mercurial > hg > soundsoftware-site
diff test/functional/news_controller_test.rb @ 41:7f0e922c8982 luisf
merged with new version from trunk
author | luisf |
---|---|
date | Fri, 19 Nov 2010 14:45:28 +0000 |
parents | 94944d00e43c |
children | af80e5618e9b |
line wrap: on
line diff
--- a/test/functional/news_controller_test.rb Thu Nov 18 17:50:11 2010 +0000 +++ b/test/functional/news_controller_test.rb Fri Nov 19 14:45:28 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