From 1bedee56314ff1de2d186ca56adbe4059f4b0af3 Mon Sep 17 00:00:00 2001 From: Ken Mazaika Date: Sun, 13 Feb 2011 19:32:27 -0500 Subject: ActiveResource validation tests did not test ActiveModel validations. Adjust the test to be done the Rails3 way. Signed-off-by: Santiago Pastorino --- activeresource/test/cases/validations_test.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'activeresource/test/cases/validations_test.rb') 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 -- cgit v1.2.3