diff options
author | Hans de Graaff <graaff@gentoo.org> | 2010-06-04 13:37:32 +0000 |
---|---|---|
committer | Hans de Graaff <graaff@gentoo.org> | 2010-06-04 13:37:32 +0000 |
commit | 754271b8c0af0e379bd7516b011e0413423c133e (patch) | |
tree | f2ddf24915017f04f372aaabda589070f62e9aea /dev-ruby | |
parent | Bumped uwsgi-module. (diff) | |
download | gentoo-2-754271b8c0af0e379bd7516b011e0413423c133e.tar.gz gentoo-2-754271b8c0af0e379bd7516b011e0413423c133e.tar.bz2 gentoo-2-754271b8c0af0e379bd7516b011e0413423c133e.zip |
Fix problems with sessions in integration tests according to https://rails.lighthouseapp.com/projects/8994/tickets/4743-session-cookie-breaks-if-used-with-custom-cookie-in-rails-238
(Portage version: 2.1.8.3/cvs/Linux x86_64)
Diffstat (limited to 'dev-ruby')
-rw-r--r-- | dev-ruby/actionpack/ChangeLog | 11 | ||||
-rw-r--r-- | dev-ruby/actionpack/actionpack-2.3.8-r1.ebuild | 43 | ||||
-rw-r--r-- | dev-ruby/actionpack/files/actionpack-2.3.8-custom-cookie-fix.patch | 81 |
3 files changed, 134 insertions, 1 deletions
diff --git a/dev-ruby/actionpack/ChangeLog b/dev-ruby/actionpack/ChangeLog index 737a9032d638..6f7d4bb68ce7 100644 --- a/dev-ruby/actionpack/ChangeLog +++ b/dev-ruby/actionpack/ChangeLog @@ -1,6 +1,15 @@ # ChangeLog for dev-ruby/actionpack # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-ruby/actionpack/ChangeLog,v 1.154 2010/05/31 05:59:53 graaff Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-ruby/actionpack/ChangeLog,v 1.155 2010/06/04 13:37:32 graaff Exp $ + +*actionpack-2.3.8-r1 (04 Jun 2010) + + 04 Jun 2010; Hans de Graaff <graaff@gentoo.org> + +actionpack-2.3.8-r1.ebuild, + +files/actionpack-2.3.8-custom-cookie-fix.patch: + Fix problems with sessions in integration tests according to + https://rails.lighthouseapp.com/projects/8994/tickets/4743-session-cookie- + breaks-if-used-with-custom-cookie-in-rails-238 *actionpack-2.3.8 (31 May 2010) diff --git a/dev-ruby/actionpack/actionpack-2.3.8-r1.ebuild b/dev-ruby/actionpack/actionpack-2.3.8-r1.ebuild new file mode 100644 index 000000000000..b54272bb21fd --- /dev/null +++ b/dev-ruby/actionpack/actionpack-2.3.8-r1.ebuild @@ -0,0 +1,43 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-ruby/actionpack/actionpack-2.3.8-r1.ebuild,v 1.1 2010/06/04 13:37:32 graaff Exp $ + +EAPI=2 + +USE_RUBY="ruby18 ree18 jruby" + +# The default test task tries to test activerecord with SQLite as well. +RUBY_FAKEGEM_TASK_TEST="test_action_pack" + +RUBY_FAKEGEM_DOCDIR="doc" +RUBY_FAKEGEM_EXTRADOC="CHANGELOG README" + +inherit ruby-fakegem + +DESCRIPTION="Eases web-request routing, handling, and response." +HOMEPAGE="http://rubyforge.org/projects/actionpack/" + +LICENSE="MIT" +SLOT="2.3" +KEYWORDS="~amd64 ~ia64 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~x64-solaris ~x86-solaris" +IUSE="" + +RUBY_PATCHES=( "${P}-custom-cookie-fix.patch" ) + +ruby_add_rdepend "~dev-ruby/activesupport-${PV} + >=dev-ruby/rack-1.1.0" + +ruby_add_bdepend test "dev-ruby/activerecord:${SLOT} dev-ruby/actionmailer:${SLOT}" + +all_ruby_prepare() { + # Custom template not found in package + sed -i -e '/horo/d' Rakefile || die + + # This tries to load a “vendorized” copy of activerecord that we + # will never have. + sed -i -e '/PATH_TO_AR/s:^:#:' test/active_record_unit.rb || die + + # Fix the testsuite, the symlink is not present in the gem for + # some reason + ln -s ../../symlink_parent test/fixtures/layout_tests/layouts/symlinked +} diff --git a/dev-ruby/actionpack/files/actionpack-2.3.8-custom-cookie-fix.patch b/dev-ruby/actionpack/files/actionpack-2.3.8-custom-cookie-fix.patch new file mode 100644 index 000000000000..ecfe4d68546c --- /dev/null +++ b/dev-ruby/actionpack/files/actionpack-2.3.8-custom-cookie-fix.patch @@ -0,0 +1,81 @@ +From 09e81c7069341ab219ddbd74817feea4a09b8172 Mon Sep 17 00:00:00 2001 +From: Jesse Storimer <jstorimer@gmail.com> +Date: Tue, 1 Jun 2010 08:35:25 -0400 +Subject: [PATCH] CookieStore should preserve the Set-Cookie header Array [#4743 state:resolved] + +--- + .../lib/action_controller/session/cookie_store.rb | 7 ++----- + .../test/controller/session/cookie_store_test.rb | 18 ++++++++++++++++-- + 2 files changed, 18 insertions(+), 7 deletions(-) + +diff --git a/actionpack/lib/action_controller/session/cookie_store.rb b/actionpack/lib/action_controller/session/cookie_store.rb +index 3d21e81..2fcee56 100644 +--- a/actionpack/lib/action_controller/session/cookie_store.rb ++++ b/actionpack/lib/action_controller/session/cookie_store.rb +@@ -114,11 +114,8 @@ module ActionController + end + + cookie = build_cookie(@key, cookie.merge(options)) +- unless headers[HTTP_SET_COOKIE].blank? +- headers[HTTP_SET_COOKIE] << "\n#{cookie}" +- else +- headers[HTTP_SET_COOKIE] = cookie +- end ++ headers[HTTP_SET_COOKIE] = [] if headers[HTTP_SET_COOKIE].blank? ++ headers[HTTP_SET_COOKIE] << cookie + end + + [status, headers, body] +diff --git a/actionpack/test/controller/session/cookie_store_test.rb b/actionpack/test/controller/session/cookie_store_test.rb +index 5ef8eec..02e9ed2 100644 +--- a/actionpack/test/controller/session/cookie_store_test.rb ++++ b/actionpack/test/controller/session/cookie_store_test.rb +@@ -44,6 +44,12 @@ class CookieStoreTest < ActionController::IntegrationTest + head :ok + end + ++ def set_session_value_and_cookie ++ cookies["foo"] = "bar" ++ session[:foo] = "bar" ++ render :text => Rack::Utils.escape(Verifier.generate(session.to_hash)) ++ end ++ + def rescue_action(e) raise end + end + +@@ -96,7 +102,7 @@ class CookieStoreTest < ActionController::IntegrationTest + with_test_route_set do + get '/set_session_value' + assert_response :success +- assert_equal "_myapp_session=#{response.body}; path=/; HttpOnly", ++ assert_equal ["_myapp_session=#{response.body}; path=/; HttpOnly"], + headers['Set-Cookie'] + end + end +@@ -164,7 +170,7 @@ class CookieStoreTest < ActionController::IntegrationTest + get '/set_session_value' + assert_response :success + session_payload = response.body +- assert_equal "_myapp_session=#{response.body}; path=/; HttpOnly", ++ assert_equal ["_myapp_session=#{response.body}; path=/; HttpOnly"], + headers['Set-Cookie'] + + get '/call_reset_session' +@@ -193,6 +199,14 @@ class CookieStoreTest < ActionController::IntegrationTest + end + end + ++ def test_setting_session_value_and_cookie ++ with_test_route_set do ++ get '/set_session_value_and_cookie' ++ assert_response :success ++ assert_equal({"_myapp_session" => response.body, "foo" => "bar"}, cookies) ++ end ++ end ++ + private + def with_test_route_set + with_routing do |set| +-- +1.7.1 + |