delegate respond_to? to decorated collection with second param
This commit is contained in:
parent
3504393678
commit
ac750a8eb9
|
@ -18,8 +18,8 @@ module Draper
|
|||
@wrapped_collection.send(method, *args, &block)
|
||||
end
|
||||
|
||||
def respond_to?(method)
|
||||
super || @wrapped_collection.respond_to?(method)
|
||||
def respond_to?(method, include_private = false)
|
||||
super || @wrapped_collection.respond_to?(method, include_private)
|
||||
end
|
||||
|
||||
def kind_of?(klass)
|
||||
|
|
|
@ -468,8 +468,8 @@ describe Draper::Base do
|
|||
|
||||
it "should delegate respond_to? to the wrapped collection" do
|
||||
decorator = ProductDecorator.decorate(paged_array)
|
||||
paged_array.should_receive(:respond_to?).with(:whatever)
|
||||
decorator.respond_to?(:whatever)
|
||||
paged_array.should_receive(:respond_to?).with(:whatever, true)
|
||||
decorator.respond_to?(:whatever, true)
|
||||
end
|
||||
|
||||
it "should return blank for a decorated empty collection" do
|
||||
|
|
Loading…
Reference in New Issue