@@ -149,6 +149,14 class NewsControllerTest < ActionController::TestCase | |||||
149 | assert_equal News.find(1), attachment.container |
|
149 | assert_equal News.find(1), attachment.container | |
150 | end |
|
150 | end | |
151 |
|
151 | |||
|
152 | def test_update_with_failure | |||
|
153 | @request.session[:user_id] = 2 | |||
|
154 | put :update, :id => 1, :news => { :description => '' } | |||
|
155 | assert_response :success | |||
|
156 | assert_template 'edit' | |||
|
157 | assert_error_tag :content => /description can't be blank/i | |||
|
158 | end | |||
|
159 | ||||
152 | def test_destroy |
|
160 | def test_destroy | |
153 | @request.session[:user_id] = 2 |
|
161 | @request.session[:user_id] = 2 | |
154 | delete :destroy, :id => 1 |
|
162 | delete :destroy, :id => 1 |
General Comments 0
You need to be logged in to leave comments.
Login now