Additional tests for DocumentsController.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8264 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2011-12-17 17:47:27 +00:00
parent b4af45537a
commit 92e4708ee3
1 changed files with 16 additions and 0 deletions

View File

@ -115,6 +115,15 @@ LOREM
assert_equal 1, ActionMailer::Base.deliveries.size
end
def test_create_with_failure
@request.session[:user_id] = 2
assert_no_difference 'Document.count' do
post :create, :project_id => 'ecookbook', :document => { :title => ''}
end
assert_response :success
assert_template 'new'
end
def test_edit
@request.session[:user_id] = 2
get :edit, :id => 1
@ -130,6 +139,13 @@ LOREM
assert_equal 'test_update', document.title
end
def test_update_with_failure
@request.session[:user_id] = 2
put :update, :id => 1, :document => {:title => ''}
assert_response :success
assert_template 'edit'
end
def test_destroy
@request.session[:user_id] = 2
assert_difference 'Document.count', -1 do