diff options
Diffstat (limited to 'actionpack/test')
-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 |