aboutsummaryrefslogtreecommitdiffstats
path: root/activeresource/test/cases
diff options
context:
space:
mode:
authorKen Mazaika <kmazaika@gmail.com>2011-02-13 19:32:27 -0500
committerSantiago Pastorino <santiago@wyeworks.com>2011-02-15 12:04:42 -0200
commit1bedee56314ff1de2d186ca56adbe4059f4b0af3 (patch)
tree06efc82024d70caae2bac241a69b6e9770bc6f59 /activeresource/test/cases
parent471327169d3f3e138beeab6b6b0003bf89d92f91 (diff)
downloadrails-1bedee56314ff1de2d186ca56adbe4059f4b0af3.tar.gz
rails-1bedee56314ff1de2d186ca56adbe4059f4b0af3.tar.bz2
rails-1bedee56314ff1de2d186ca56adbe4059f4b0af3.zip
ActiveResource validation tests did not test ActiveModel validations. Adjust the test to be done the Rails3 way.
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
Diffstat (limited to 'activeresource/test/cases')
-rw-r--r--activeresource/test/cases/validations_test.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/activeresource/test/cases/validations_test.rb b/activeresource/test/cases/validations_test.rb
index bd79fdd952..671d1ea8f0 100644
--- a/activeresource/test/cases/validations_test.rb
+++ b/activeresource/test/cases/validations_test.rb
@@ -48,6 +48,12 @@ class ValidationsTest < ActiveModel::TestCase
assert p.save, "should have saved after fixing the validation, but had: #{p.errors.inspect}"
end
+ def test_client_side_validation_maximum
+ project = Project.new(:description => '123456789012345')
+ assert ! project.valid?
+ assert_equal ['is too long (maximum is 10 characters)'], project.errors[:description]
+ end
+
protected
# quickie helper to create a new project with all the required