This commit is contained in:
Michael Fairley 2011-09-29 11:57:49 -07:00
parent 533da82a16
commit 58823a3d49
3 changed files with 4 additions and 4 deletions

View File

@ -139,7 +139,7 @@ module Draper
def respond_to?(method) def respond_to?(method)
if select_methods.include?(method) if select_methods.include?(method)
model.repsond_to?(method) model.respond_to?(method)
else else
super super
end end

View File

@ -163,11 +163,11 @@ describe Draper::Base do
let(:subject_with_allows){ DecoratorWithAllows.new(source) } let(:subject_with_allows){ DecoratorWithAllows.new(source) }
it "should echo the allowed method" do it "should echo the allowed method" do
subject_with_allows.should respond_to(:upcase) subject_with_allows.should respond_to(:goodnight_moon)
end end
it "should echo _only_ the allowed method" do it "should echo _only_ the allowed method" do
subject_with_allows.should_not respond_to(:downcase) subject_with_allows.should_not respond_to(:hello_world)
end end
end end

View File

@ -1,3 +1,3 @@
class DecoratorWithAllows < Draper::Base class DecoratorWithAllows < Draper::Base
allows :upcase allows :goodnight_moon
end end