Class Spec::Rails::Example::CookiesProxy

  1. lib/spec/rails/example/cookies_proxy.rb
Parent: Object

Methods

public class

  1. new

public instance

  1. []
  2. []=
  3. delete

Public class methods

new (example)
[show source]
# File lib/spec/rails/example/cookies_proxy.rb, line 7
        def initialize(example)
          @example = example
        end

Public instance methods

[] (name)
[show source]
# File lib/spec/rails/example/cookies_proxy.rb, line 19
        def [](name)
          @example.response.cookies[name.to_s]
        end
[]= (name, value)
[show source]
# File lib/spec/rails/example/cookies_proxy.rb, line 11
        def[]=(name, value)
          if ::Rails::VERSION::STRING >= '2.3'
            @example.request.cookies[name.to_s] = value
          else
            @example.request.cookies[name.to_s] = CGI::Cookie.new(name.to_s, value)
          end
        end
delete (name)
[show source]
# File lib/spec/rails/example/cookies_proxy.rb, line 23
        def delete(name)
          @example.response.cookies.delete(name.to_s)
        end