<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -9,7 +9,11 @@ module Spec
         end
       
         def[]=(name, value)
-          @example.request.cookies[name.to_s] = CGI::Cookie.new(name.to_s, value)
+          if ::Rails::VERSION::STRING &gt;= '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)</diff>
      <filename>lib/spec/rails/example/cookies_proxy.rb</filename>
    </modified>
    <modified>
      <diff>@@ -44,11 +44,23 @@ module Spec
         #   post :login
         #   cookies[:login].expires.should == 1.week.from_now
         #
-        # == Examples (Rails &gt;= 2.0.0 only)
+        # == Examples (Rails 2.0 &gt; 2.2)
         #
         #   cookies[:user_id] = {:value =&gt; '1234', :expires =&gt; 1.minute.ago}
         #   get :index
         #   response.should be_redirect
+        #
+        # == Examples (Rails 2.3)
+        #
+        # Rails 2.3 changes the way cookies are made available to functional
+        # tests (and therefore rspec controller specs), only making single
+        # values available with no access to other aspects of the cookie. This
+        # is backwards-incompatible, so you have to change your examples to
+        # look like this:
+        #
+        #   cookies[:foo] = 'bar'
+        #   get :index
+        #   cookies[:foo].should == 'bar'
         def cookies
           @cookies ||= Spec::Rails::Example::CookiesProxy.new(self)
         end</diff>
      <filename>lib/spec/rails/example/functional_example_group.rb</filename>
    </modified>
    <modified>
      <diff>@@ -144,12 +144,20 @@ require 'controller_spec_controller'
   
       it &quot;should support a Symbol key&quot; do
         get 'action_which_sets_cookie', :value =&gt; &quot;cookie value&quot;
-        cookies[:cookie_key].value.should == [&quot;cookie value&quot;]
+        if Rails::VERSION::STRING &gt;= &quot;2.3&quot;
+          cookies[:cookie_key].should == &quot;cookie+value&quot;
+        else
+          cookies[:cookie_key].should == [&quot;cookie value&quot;]
+        end
       end
 
       it &quot;should support a String key&quot; do
         get 'action_which_sets_cookie', :value =&gt; &quot;cookie value&quot;
-        cookies['cookie_key'].value.should == [&quot;cookie value&quot;]
+        if Rails::VERSION::STRING &gt;= &quot;2.3&quot;
+          cookies['cookie_key'].should == &quot;cookie+value&quot;
+        else
+          cookies['cookie_key'].should == [&quot;cookie value&quot;]
+        end
       end
     
     end</diff>
      <filename>spec/spec/rails/example/controller_spec_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,6 +3,7 @@ require File.dirname(__FILE__) + '/../../../spec_helper'
 class CookiesProxyExamplesController &lt; ActionController::Base
   def index
     cookies[:key] = cookies[:key]
+    render :text =&gt; &quot;&quot;
   end
 end
 
@@ -18,18 +19,26 @@ module Spec
             cookies = CookiesProxy.new(self)
             cookies['key'] = 'value'
             get :index
-            cookies['key'].should == ['value']
+            if ::Rails::VERSION::STRING &gt;= &quot;2.3&quot;
+              cookies['key'].should == 'value'
+            else
+              cookies['key'].should == ['value']
+            end
           end
           
-          if Rails::VERSION::STRING &gt;= &quot;2.0.0&quot;
+          if ::Rails::VERSION::STRING &gt;= &quot;2.0.0&quot;
             it &quot;should accept a Hash value&quot; do
               cookies = CookiesProxy.new(self)
               cookies['key'] = { :value =&gt; 'value', :expires =&gt; expiration = 1.hour.from_now, :path =&gt; path = '/path' }
               get :index
-              cookies['key'].should == ['value']
-              cookies['key'].value.should == ['value']
-              cookies['key'].expires.should == expiration
-              cookies['key'].path.should == path
+              if ::Rails::VERSION::STRING &gt;= &quot;2.3&quot;
+                cookies['key'].should == 'value'
+              else
+                cookies['key'].should == ['value']
+                cookies['key'].value.should == ['value']
+                cookies['key'].expires.should == expiration
+                cookies['key'].path.should == path
+              end
             end
           end
             
@@ -41,18 +50,26 @@ module Spec
             example_cookies = CookiesProxy.new(self)
             example_cookies[:key] = 'value'
             get :index
-            example_cookies[:key].should == ['value']
+            if ::Rails::VERSION::STRING &gt;= &quot;2.3&quot;
+              example_cookies[:key].should == 'value'
+            else
+              example_cookies[:key].should == ['value']
+            end
           end
 
-          if Rails::VERSION::STRING &gt;= &quot;2.0.0&quot;
+          if ::Rails::VERSION::STRING &gt;= &quot;2.0.0&quot;
             it &quot;should accept a Hash value&quot; do
               example_cookies = CookiesProxy.new(self)
               example_cookies[:key] = { :value =&gt; 'value', :expires =&gt; expiration = 1.hour.from_now, :path =&gt; path = '/path' }
               get :index
-              example_cookies[:key].should == ['value']
-              example_cookies[:key].value.should == ['value']
-              example_cookies[:key].expires.should == expiration
-              example_cookies[:key].path.should == path
+              if ::Rails::VERSION::STRING &gt;= &quot;2.3&quot;
+                example_cookies[:key].should == 'value'
+              else
+                example_cookies[:key].should == ['value']
+                example_cookies[:key].value.should == ['value']
+                example_cookies[:key].expires.should == expiration
+                example_cookies[:key].path.should == path
+              end
             end
           end
 </diff>
      <filename>spec/spec/rails/example/cookies_proxy_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>a71fe7dfe5f3074deec3da5c81cd7e33d6ce1123</id>
    </parent>
  </parents>
  <author>
    <name>David Chelimsky</name>
    <email>dchelimsky@gmail.com</email>
  </author>
  <url>http://github.com/dchelimsky/rspec-rails/commit/eb828293c87145aca7efb1411becc299166c5ce6</url>
  <id>eb828293c87145aca7efb1411becc299166c5ce6</id>
  <committed-date>2008-12-29T22:06:54-08:00</committed-date>
  <authored-date>2008-12-29T22:06:54-08:00</authored-date>
  <message>support changes to cookie handling in edge rails (2.3.0)</message>
  <tree>b11a328c5c5edefe10987c4f8ffa9f369e23caac</tree>
  <committer>
    <name>David Chelimsky</name>
    <email>dchelimsky@gmail.com</email>
  </committer>
</commit>
