require 'abstract_unit'
class ActiveModelHelperTest < ActionView::TestCase
tests ActionView::Helpers::ActiveModelHelper
silence_warnings do
class Post < Struct.new(:author_name, :body, :updated_at)
include ActiveModel::Conversion
include ActiveModel::Validations
def persisted?
false
end
end
end
def setup
super
@post = Post.new
@post.errors[:author_name] << "can't be empty"
@post.errors[:body] << "foo"
@post.errors[:updated_at] << "bar"
@post.author_name = ""
@post.body = "Back to the hill and over it again!"
@post.updated_at = Date.new(2004, 6, 15)
end
def test_text_area_with_errors
assert_dom_equal(
%(