From 43359e0efc85d9b6bdb35380eb41152f0cdce820 Mon Sep 17 00:00:00 2001 From: Andrew Haines Date: Sat, 30 Mar 2013 17:33:50 +0000 Subject: [PATCH] Fix bad test --- spec/draper/decorator_spec.rb | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/spec/draper/decorator_spec.rb b/spec/draper/decorator_spec.rb index f85679d..e160dbc 100755 --- a/spec/draper/decorator_spec.rb +++ b/spec/draper/decorator_spec.rb @@ -380,13 +380,18 @@ module Draper end describe "#==" do - it "ensures the source has a decoration-aware #==" do + it "works for a source that does not include Decoratable" do source = Object.new decorator = Decorator.new(source) - expect(source).not_to be_a_kind_of Draper::Decoratable::Equality - decorator == :something - expect(source).to be_a_kind_of Draper::Decoratable::Equality + expect(decorator).to eq Decorator.new(source) + end + + it "works for a multiply-decorated source that does not include Decoratable" do + source = Object.new + decorator = Decorator.new(source) + + expect(decorator).to eq ProductDecorator.new(Decorator.new(source)) end it "is true when source #== is true" do