lib/spec/rails/example/functional_example_group.rb in dchelimsky-rspec-rails-1.1.11.4 vs lib/spec/rails/example/functional_example_group.rb in dchelimsky-rspec-rails-1.1.11.5
- old
+ new
@@ -42,14 +42,26 @@
# assigns[:user].id.should == '1234'
#
# post :login
# cookies[:login].expires.should == 1.week.from_now
#
- # == Examples (Rails >= 2.0.0 only)
+ # == Examples (Rails 2.0 > 2.2)
#
# cookies[:user_id] = {:value => '1234', :expires => 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
alias_method :orig_assigns, :assigns