test/errors_test.rb in reform-1.1.0 vs test/errors_test.rb in reform-1.1.1
- old
+ new
@@ -117,6 +117,14 @@
it { @result.must_equal true }
it { form.hit.title.must_equal "Sacrifice" }
it { form.title.must_equal "Second Heat" }
it { form.songs.first.title.must_equal "Heart Of A Lion" }
end
+
+
+ describe "Errors#to_s" do
+ before { form.validate("songs"=>[{"title" => ""}], "band" => {"label" => {}}) }
+
+ # to_s is aliased to messages
+ it { form.errors.to_s.must_equal "{:\"songs.title\"=>[\"can't be blank\"], :\"band.label.name\"=>[\"can't be blank\"]}" }
+ end
end
\ No newline at end of file