diff options
author | Yehuda Katz <wycats@gmail.com> | 2009-07-20 00:58:59 +0900 |
---|---|---|
committer | Yehuda Katz <wycats@gmail.com> | 2009-07-20 00:58:59 +0900 |
commit | 13e18dd94000cef2b2058b96d62de16b7d3a2200 (patch) | |
tree | 54b5cbd18b31066744e67e226d8d603f70a5f8c6 /actionpack/test/template | |
parent | 5ffaaa71d149c9807260c950c9a61d01fe734827 (diff) | |
download | rails-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')
-rw-r--r-- | actionpack/test/template/active_record_helper_i18n_test.rb | 1 | ||||
-rw-r--r-- | actionpack/test/template/form_helper_test.rb | 10 | ||||
-rw-r--r-- | actionpack/test/template/record_tag_helper_test.rb | 2 |
3 files changed, 7 insertions, 6 deletions
diff --git a/actionpack/test/template/active_record_helper_i18n_test.rb b/actionpack/test/template/active_record_helper_i18n_test.rb index 9d04c882c8..7dda9fe275 100644 --- a/actionpack/test/template/active_record_helper_i18n_test.rb +++ b/actionpack/test/template/active_record_helper_i18n_test.rb @@ -1,6 +1,7 @@ require 'abstract_unit' class ActiveRecordHelperI18nTest < Test::Unit::TestCase + include ActionView::Context include ActionView::Helpers::ActiveRecordHelper attr_reader :request 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 diff --git a/actionpack/test/template/record_tag_helper_test.rb b/actionpack/test/template/record_tag_helper_test.rb index 861958ffa9..bae26f555d 100644 --- a/actionpack/test/template/record_tag_helper_test.rb +++ b/actionpack/test/template/record_tag_helper_test.rb @@ -6,7 +6,7 @@ class Post 45 end def body - "What a wonderful world!" + super || "What a wonderful world!" end end |