Added #decorated? method to Draper::CollectionDecorator

Closes #447
This commit is contained in:
Carlos Eduardo L. Lopes 2013-02-06 11:05:40 -02:00
parent ea27146398
commit 65e3c4e457
2 changed files with 13 additions and 0 deletions

View File

@ -70,6 +70,11 @@ module Draper
@decorator_class ||= self.class.inferred_decorator_class
end
# @return [true]
def decorated?
true
end
protected
# @return the collection being decorated.

View File

@ -255,5 +255,13 @@ module Draper
end
end
describe '#decorated?' do
it 'returns true' do
decorator = ProductsDecorator.new([Product.new])
expect(decorator).to be_decorated
end
end
end
end