From ad87c04d4e4017d64d53f4bdf61acbdb1ae346dc Mon Sep 17 00:00:00 2001 From: nathanvda Date: Sat, 7 Apr 2012 00:35:57 +0200 Subject: [PATCH] When using an overriden assocation-name, we generate correct plurals. --- spec/cocoon_spec.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/spec/cocoon_spec.rb b/spec/cocoon_spec.rb index 069f4e8..818bc79 100644 --- a/spec/cocoon_spec.rb +++ b/spec/cocoon_spec.rb @@ -54,6 +54,13 @@ describe Cocoon do end end + context "when using aliased association and class-name" do + it "uses the correct name" do + result = @tester.link_to_add_association('add something', @form_obj, :admin_comments) + result.to_s.should == 'add something' + end + end + it "tttt" do @post.class.reflect_on_association(:people).klass.new.should be_a(Person) end