Fix problems with sessions in integration tests according to https://rails.lighthouse...
authorHans de Graaff <graaff@gentoo.org>
Fri, 4 Jun 2010 13:37:32 +0000 (13:37 +0000)
committerHans de Graaff <graaff@gentoo.org>
Fri, 4 Jun 2010 13:37:32 +0000 (13:37 +0000)
Package-Manager: portage-2.1.8.3/cvs/Linux x86_64

dev-ruby/actionpack/ChangeLog
dev-ruby/actionpack/Manifest
dev-ruby/actionpack/actionpack-2.3.8-r1.ebuild [new file with mode: 0644]
dev-ruby/actionpack/files/actionpack-2.3.8-custom-cookie-fix.patch [new file with mode: 0644]

index 737a9032d638f4c738a011077d436a7012920945..6f7d4bb68ce7481ac397ef01be5c65095da5ea60 100644 (file)
@@ -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)
 
index f2320ab3a13b8a606dfce1cae643192c3fbb8f85..2416dc438b55adbd90b95baac782951fa86a29fa 100644 (file)
@@ -2,19 +2,21 @@
 Hash: SHA1
 
 AUX actionpack-2.2.3-strip_tags.patch 649 RMD160 d503951da305c307911dc51c84e56783712bf6f2 SHA1 76e50d0fa191502cb4f6fe25df52860b62244828 SHA256 b96743939465ed9bd042e741f888aba95d3327f97b182d41554a5b5364d3e57b
+AUX actionpack-2.3.8-custom-cookie-fix.patch 3009 RMD160 ede4f92f154a36e8b25e11ab92f9ef229e8208de SHA1 d367e0aa9917ee536214a32fd35cd35d96b55b39 SHA256 9368cd7b35fbc0b5d4161e121aa9ced113ea831b738a47b6c59828bb17f24c04
 DIST actionpack-2.2.3.gem 718848 RMD160 6b5407cf15a0a0874bd959d650a7f66894485a50 SHA1 cae01c4d1622286705ab9ff0d963eda6b104c96e SHA256 f00dc9b5fe33b56797550ea4e1111a44e5acd413ecb7ad8dbc184f58bd704fb5
 DIST actionpack-2.3.5.gem 737792 RMD160 b9b9f1451ecdf050ca9a376e6fde020e7aebdb61 SHA1 6c46dbcbde1840202ebd2bcfa690d53047e47c9e SHA256 28630d5955c36290fdc8918966e45f1d1a48514b663b43f3459dd9453b35370c
 DIST actionpack-2.3.8.gem 743424 RMD160 41e00f115bcf3a8417007d6f552d13e553a97bef SHA1 8097a30753f70f57dfa75c9907428555e4e872e9 SHA256 98bff14ff6981f5709b3d43f47bb25fcfeff70b2b75a93cf9aa74a12ba6fd14f
 EBUILD actionpack-2.2.3-r1.ebuild 771 RMD160 3106d00d948464385c4c0b4f84e85925229dc397 SHA1 5779d4c7b55885cafd47acb8a1d8659912984515 SHA256 e5a14491a48fe95414da17d3217f6adbf639ba0c67d26688c29d90d2454131b1
 EBUILD actionpack-2.3.5-r1.ebuild 1371 RMD160 2ca2517b0ea5561f2792b92c7b63d647ed1d2003 SHA1 a0d303e3be0f7cb2b68fda7eccaf2a65a70f2b2a SHA256 14728df0a55efc789139ceada15eb2154e3b923e132f6d9566ab0145215febad
 EBUILD actionpack-2.3.5.ebuild 648 RMD160 2149e057f7fb73d5dddd8f09e938177dfe657109 SHA1 9cbbee59eb3d3e3caa5682687386f90aace08dd4 SHA256 eb10b8c2e785da75b2262a8e099a05b7fb1562035cb6a528b81652db03fdab1f
+EBUILD actionpack-2.3.8-r1.ebuild 1351 RMD160 ecb23c392164c259c4e49a8cf22822b2cc670405 SHA1 3e43613719c695df71015bb885881d825c022e48 SHA256 36e83c7d72ecf6a6a493f716e5e2052f1707ab5d67231c8e8b2b312b397d88a0
 EBUILD actionpack-2.3.8.ebuild 1299 RMD160 aadf84cdbd56e0bf0d5d05c1bfd71fe9fa6cbfac SHA1 1d1cbd95713cb7c64799522fa990e011d34e30ff SHA256 ec48d1f61c3d7555babfcba691f6be745569d6e7019614547c4ca547624fc025
-MISC ChangeLog 19919 RMD160 88a40fdb4b4ebeaccb305909b194819156bb3ab1 SHA1 35cc93ad95f48c4eb6190c65f36923d30e98f79d SHA256 4dc7d63df6e2298a72a2c69d6175e5a2cbe96e366a865b86bff4d220a11056a3
+MISC ChangeLog 20277 RMD160 6c9e4ccc055892918281e0b79c38000fc48fd3c4 SHA1 c3aa6358a3809cd1193324d3cfd7febd63d58db0 SHA256 3968d9831be18ff1b3f75aca351011571b1b9ced14df883ffa19cd96e6eaf70c
 MISC metadata.xml 157 RMD160 5d9e2c7ecba96ffebd936d38acedf859cdea84e1 SHA1 8ce15dcc608eeb5616aeec610dc695cbe6f93e02 SHA256 11fba03a217e2d996f5cd8895493a5692ece8ddac2c1a2dfc71d0e830555121c
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.15 (GNU/Linux)
 
-iEYEARECAAYFAkwDUF8ACgkQeM7EJeUH71O6oQCfdfER2TBq2wOXY5muSIrQIr7N
-jWYAnjWD+wFwDKJPsDvnUhsCl010xUrx
-=9Yjj
+iEYEARECAAYFAkwJAaYACgkQeM7EJeUH71PV1gCfclsRmEOSW9sX0G3o5t8cond8
+FcAAnRemLxd5Np3vV1O+GL56B1sULHB/
+=2pBl
 -----END PGP SIGNATURE-----
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 (file)
index 0000000..b54272b
--- /dev/null
@@ -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 (file)
index 0000000..ecfe4d6
--- /dev/null
@@ -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
+