diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-02-05 16:19:29 -0200 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-02-05 16:19:29 -0200 |
commit | 0caac9bf9b58f29f474675c18366413364df87c1 (patch) | |
tree | 8df32d0088b4f1da0b4acf59c33bdb07f3c158b6 /actionview/test/lib | |
parent | 79100b8a3a8057c5826dc064fea91b73f0080b4c (diff) | |
download | rails-0caac9bf9b58f29f474675c18366413364df87c1.tar.gz rails-0caac9bf9b58f29f474675c18366413364df87c1.tar.bz2 rails-0caac9bf9b58f29f474675c18366413364df87c1.zip |
Add tests to make sure label and placeholder respect to_model
Diffstat (limited to 'actionview/test/lib')
-rw-r--r-- | actionview/test/lib/controller/fake_models.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/actionview/test/lib/controller/fake_models.rb b/actionview/test/lib/controller/fake_models.rb index 789b1d198b..65c68fc34a 100644 --- a/actionview/test/lib/controller/fake_models.rb +++ b/actionview/test/lib/controller/fake_models.rb @@ -54,6 +54,22 @@ class Post < Struct.new(:title, :author_name, :body, :secret, :persisted, :writt def tags_attributes=(attributes); end end +class PostDelegator < Post + def to_model + PostDelegate.new + end +end + +class PostDelegate < Post + def self.human_attribute_name(attribute) + "Delegate #{super}" + end + + def model_name + ActiveModel::Name.new(self.class) + end +end + class Comment extend ActiveModel::Naming include ActiveModel::Conversion |