aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template/form_helper_test.rb
diff options
context:
space:
mode:
authorYehuda Katz <wycats@gmail.com>2009-07-20 00:58:59 +0900
committerYehuda Katz <wycats@gmail.com>2009-07-20 00:58:59 +0900
commit13e18dd94000cef2b2058b96d62de16b7d3a2200 (patch)
tree54b5cbd18b31066744e67e226d8d603f70a5f8c6 /actionpack/test/template/form_helper_test.rb
parent5ffaaa71d149c9807260c950c9a61d01fe734827 (diff)
downloadrails-13e18dd94000cef2b2058b96d62de16b7d3a2200.tar.gz
rails-13e18dd94000cef2b2058b96d62de16b7d3a2200.tar.bz2
rails-13e18dd94000cef2b2058b96d62de16b7d3a2200.zip
Update some tests and add a to_model to form helpers
Diffstat (limited to 'actionpack/test/template/form_helper_test.rb')
-rw-r--r--actionpack/test/template/form_helper_test.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/actionpack/test/template/form_helper_test.rb b/actionpack/test/template/form_helper_test.rb
index bc24ea3556..431ac35e54 100644
--- a/actionpack/test/template/form_helper_test.rb
+++ b/actionpack/test/template/form_helper_test.rb
@@ -1,11 +1,9 @@
require 'abstract_unit'
silence_warnings do
- Post = Struct.new(:title, :author_name, :body, :secret, :written_on, :cost)
- Post.class_eval do
- alias_method :title_before_type_cast, :title unless respond_to?(:title_before_type_cast)
- alias_method :body_before_type_cast, :body unless respond_to?(:body_before_type_cast)
- alias_method :author_name_before_type_cast, :author_name unless respond_to?(:author_name_before_type_cast)
+ class Post < Struct.new(:title, :author_name, :body, :secret, :written_on, :cost)
+ extend ActiveModel::APICompliant
+
alias_method :secret?, :secret
def new_record=(boolean)
@@ -27,6 +25,8 @@ silence_warnings do
end
class Comment
+ extend ActiveModel::APICompliant
+
attr_reader :id
attr_reader :post_id
def initialize(id = nil, post_id = nil); @id, @post_id = id, post_id end