Sha256: bf6efbcdfd1601f9d2f02470ea28ca46a2973a9549511082de8ce80ac5a7a33b

Contents?: true

Size: 659 Bytes

Versions: 51

Compression:

Stored size: 659 Bytes

Contents

require 'action_controller/cookies'

module Spec
  module Rails
    module Example
      class CookiesProxy
        def initialize(example)
          @example = example
        end
      
        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
        
        def [](name)
          @example.response.cookies[name.to_s]
        end
      
        def delete(name)
          @example.response.cookies.delete(name.to_s)
        end
      end
    end
  end
end

Version data entries

51 entries across 51 versions & 10 rubygems

Version Path
cavalle-rspec-rails-1.2.2.0.1 lib/spec/rails/example/cookies_proxy.rb
cavalle-rspec-rails-1.2.2.0.2 lib/spec/rails/example/cookies_proxy.rb
cavalle-rspec-rails-1.2.3.1 lib/spec/rails/example/cookies_proxy.rb
cavalle-rspec-rails-1.2.4.0.1 lib/spec/rails/example/cookies_proxy.rb
dchelimsky-rspec-rails-1.1.11.5 lib/spec/rails/example/cookies_proxy.rb
dchelimsky-rspec-rails-1.1.11.6 lib/spec/rails/example/cookies_proxy.rb
dchelimsky-rspec-rails-1.1.11.7 lib/spec/rails/example/cookies_proxy.rb
dchelimsky-rspec-rails-1.1.12 lib/spec/rails/example/cookies_proxy.rb
dchelimsky-rspec-rails-1.1.99.1 lib/spec/rails/example/cookies_proxy.rb
dchelimsky-rspec-rails-1.1.99.13 lib/spec/rails/example/cookies_proxy.rb
dchelimsky-rspec-rails-1.1.99.2 lib/spec/rails/example/cookies_proxy.rb
dchelimsky-rspec-rails-1.1.99.3 lib/spec/rails/example/cookies_proxy.rb
dchelimsky-rspec-rails-1.1.99.4 lib/spec/rails/example/cookies_proxy.rb
dchelimsky-rspec-rails-1.1.99.5 lib/spec/rails/example/cookies_proxy.rb
dchelimsky-rspec-rails-1.1.99.6 lib/spec/rails/example/cookies_proxy.rb
dchelimsky-rspec-rails-1.1.99.7 lib/spec/rails/example/cookies_proxy.rb
dchelimsky-rspec-rails-1.1.99.8 lib/spec/rails/example/cookies_proxy.rb
dchelimsky-rspec-rails-1.1.99.9 lib/spec/rails/example/cookies_proxy.rb
mcmire-rspec-rails-1.1.99.9 lib/spec/rails/example/cookies_proxy.rb
radiant-1.0.0 ruby-debug/ruby/1.8/gems/rspec-rails-1.3.4/lib/spec/rails/example/cookies_proxy.rb