Method: Merb::Test::CookieJar#update
- Defined in:
- lib/merb-core/test/helpers/cookie_jar.rb
#update(jar, uri, raw_cookies) ⇒ Object
:api: private
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
# File 'lib/merb-core/test/helpers/cookie_jar.rb', line 83 def update(jar, uri, ) return unless # Initialize all the the received cookies = [] .each do |raw| c = Cookie.new(raw, uri.host) << c if c.valid?(uri) end @jars[jar] ||= [] # Remove all the cookies that will be updated @jars[jar].delete_if do |existing| .find { |c| [c.name, c.domain, c.path] == [existing.name, existing.domain, existing.path] } end @jars[jar].concat @jars[jar].sort! end |