Skip to content

Commit

Permalink
BUGFIX: fix broken spec
Browse files Browse the repository at this point in the history
  • Loading branch information
SamSaffron committed Jan 9, 2014
1 parent 177983a commit 74c1555
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/middleware/anonymous_cache.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ def initialize(env)
@env = env
end

def is_mobile=(val)
@is_mobile = val ? :true : :false
end

def is_mobile?
@is_mobile ||=
begin
Expand Down
1 change: 1 addition & 0 deletions spec/components/middleware/anonymous_cache_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def new_helper(env={})
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"]]
Expand Down

0 comments on commit 74c1555

Please sign in to comment.