Class: Merb::Test::RequestHelper::CookieJar

Inherits:
Mash
  • Object
show all
Defined in:
lib/merb-core/test/helpers/mock_request_helper.rb

Overview

CookieJar keeps track of cookies in a simple Mash.

Instance Method Summary collapse

Instance Method Details

#update_from_request(request) ⇒ Object

Parameters

request<Merb::Request, Merb::FakeRequest>

The controller request.



55
56
57
58
59
60
61
62
63
# File 'lib/merb-core/test/helpers/mock_request_helper.rb', line 55

def update_from_request(request)
  request.cookies.each do |key, value|
    if value.blank?
      self.delete(key)
    else
      self[key] = Merb::Parse.unescape(value)
    end
  end
end