diff --git a/lib/draper/base.rb b/lib/draper/base.rb index 5d995a0..bc9131a 100644 --- a/lib/draper/base.rb +++ b/lib/draper/base.rb @@ -211,7 +211,7 @@ module Draper alias :is_a? :kind_of? def respond_to?(method, include_private = false) - super || (allow?(method) && model.respond_to?(method)) + super || (allow?(method) && model.respond_to?(method, include_private)) end def method_missing(method, *args, &block) diff --git a/spec/draper/base_spec.rb b/spec/draper/base_spec.rb index 39c6f97..2ff9e0c 100644 --- a/spec/draper/base_spec.rb +++ b/spec/draper/base_spec.rb @@ -414,6 +414,14 @@ describe Draper::Base do end end + context ".respond_to?" do + it "should delegate respond_to? to the decorated model" do + other = Draper::Base.new(source) + source.should_receive(:respond_to?).with(:whatever, true) + subject.respond_to?(:whatever, true) + end + end + context 'position accessors' do [:first, :last].each do |method| context "##{method}" do