Adds a test for when updating a news fails.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9054 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
9ffccf5304
commit
9634fe054a
@ -149,6 +149,14 @@ class NewsControllerTest < ActionController::TestCase
|
|||||||
assert_equal News.find(1), attachment.container
|
assert_equal News.find(1), attachment.container
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_update_with_failure
|
||||||
|
@request.session[:user_id] = 2
|
||||||
|
put :update, :id => 1, :news => { :description => '' }
|
||||||
|
assert_response :success
|
||||||
|
assert_template 'edit'
|
||||||
|
assert_error_tag :content => /description can't be blank/i
|
||||||
|
end
|
||||||
|
|
||||||
def test_destroy
|
def test_destroy
|
||||||
@request.session[:user_id] = 2
|
@request.session[:user_id] = 2
|
||||||
delete :destroy, :id => 1
|
delete :destroy, :id => 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user