diff test/functional/versions_controller_test.rb @ 51:371eac10df0b live

* Merge from "cannam" branch. This includes update to Redmine trunk, plus welcome/tip-of-the-day from luisf branch.
author Chris Cannam
date Wed, 24 Nov 2010 12:20:08 +0000
parents 94944d00e43c
children af80e5618e9b
line wrap: on
line diff
--- a/test/functional/versions_controller_test.rb	Thu Oct 21 11:19:14 2010 +0100
+++ b/test/functional/versions_controller_test.rb	Wed Nov 24 12:20:08 2010 +0000
@@ -123,6 +123,15 @@
     assert_equal 'New version name', version.name
     assert_equal Date.today, version.effective_date
   end
+  
+  def test_post_update_with_validation_failure
+    @request.session[:user_id] = 2
+    put :update, :id => 2, 
+                 :version => { :name => '', 
+                               :effective_date => Date.today.strftime("%Y-%m-%d")}
+    assert_response :success
+    assert_template 'edit'
+  end
 
   def test_destroy
     @request.session[:user_id] = 2