From 74c155588571e70df94be5419209fe8bc8b189c2 Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 9 Jan 2014 15:11:04 +1100 Subject: [PATCH] BUGFIX: fix broken spec --- lib/middleware/anonymous_cache.rb | 4 ++++ spec/components/middleware/anonymous_cache_spec.rb | 1 + 2 files changed, 5 insertions(+) diff --git a/lib/middleware/anonymous_cache.rb b/lib/middleware/anonymous_cache.rb index 0eb7ae658..bb87f3d0b 100644 --- a/lib/middleware/anonymous_cache.rb +++ b/lib/middleware/anonymous_cache.rb @@ -12,6 +12,10 @@ module Middleware @env = env end + def is_mobile=(val) + @is_mobile = val ? :true : :false + end + def is_mobile? @is_mobile ||= begin diff --git a/spec/components/middleware/anonymous_cache_spec.rb b/spec/components/middleware/anonymous_cache_spec.rb index a72b94b84..5eb3b5954 100644 --- a/spec/components/middleware/anonymous_cache_spec.rb +++ b/spec/components/middleware/anonymous_cache_spec.rb @@ -35,6 +35,7 @@ describe Middleware::AnonymousCache::Helper do end it "returns cached data for cached requests" do + helper.is_mobile = true helper.cached.should be_nil helper.cache([200, {"HELLO" => "WORLD"}, ["hello ", "world"]]) helper.cached.should == [200, {"HELLO" => "WORLD"}, ["hello world"]]