diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2011-12-17 17:47:27 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2011-12-17 17:47:27 +0000 |
commit | 92e4708ee36891179cf7ac39bf692b65989b8654 (patch) | |
tree | 2cad30910fafd86c4fdb73345638d64f285e18d1 /test | |
parent | b4af45537a02bfdfb768f0e2a432079f2771f800 (diff) | |
download | redmine-92e4708ee36891179cf7ac39bf692b65989b8654.tar.gz redmine-92e4708ee36891179cf7ac39bf692b65989b8654.zip |
Additional tests for DocumentsController.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8264 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/documents_controller_test.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/functional/documents_controller_test.rb b/test/functional/documents_controller_test.rb index 3b4424e51..28a320cb2 100644 --- a/test/functional/documents_controller_test.rb +++ b/test/functional/documents_controller_test.rb @@ -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 |