From 1d22eba498f14f6e62360884da15c59deb1ff551 Mon Sep 17 00:00:00 2001 From: Brian Meeker Date: Sat, 7 Apr 2012 11:34:10 -0400 Subject: [PATCH] Added a new example that passes options to link_to_add_association with a block for the name. The test fails. --- spec/cocoon_spec.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/spec/cocoon_spec.rb b/spec/cocoon_spec.rb index e20cf14..dc36ec2 100644 --- a/spec/cocoon_spec.rb +++ b/spec/cocoon_spec.rb @@ -45,6 +45,14 @@ describe Cocoon do result.to_s.should == 'some long name' end + it "accepts options and passes them to link_to" do + @tester.unstub(:render_association) + @tester.should_receive(:render_association).with(anything(), anything(), anything(), anything(), "shared/partial").and_return('partiallll') + result = @tester.link_to_add_association( @form_obj, :comments, {:class => 'floppy disk'}, {:partial => "shared/partial"}) do + "some long name" + end + result.to_s.should == 'some long name' + end end context "with an irregular plural" do