From 18ebac81533a6413aa20a3c26f23e91d0b12b031 Mon Sep 17 00:00:00 2001 From: Andrew Haines Date: Sun, 2 Dec 2012 12:21:43 +0000 Subject: [PATCH] Don't respond_to the source's private methods --- spec/draper/decorator_spec.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/spec/draper/decorator_spec.rb b/spec/draper/decorator_spec.rb index 84250f51..29884129 100755 --- a/spec/draper/decorator_spec.rb +++ b/spec/draper/decorator_spec.rb @@ -298,8 +298,8 @@ subject.respond_to?(:awesome_private_title, true).should be_true end - it "returns true for the source's private methods" do - subject.respond_to?(:private_title, true).should be_true + it "returns false for the source's private methods" do + subject.respond_to?(:private_title, true).should be_false end end @@ -361,6 +361,10 @@ subject.delegated_method.should == "Yay, delegation" end + it "does not proxy private methods" do + expect{subject.private_title}.to raise_error NoMethodError + end + context "with method security" do it "respects allows" do source.stub(:hello_world, :goodnight_moon).and_return(:proxied)