aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoachim Filip Ignacy Bartosik <jbartosik@gmail.com>2011-01-07 17:37:18 +0100
committerJoachim Filip Ignacy Bartosik <jbartosik@gmail.com>2011-01-07 17:37:18 +0100
commit1db84090103ca878d2d8977ceb6dda1f69afd1b2 (patch)
tree41cb03b5e7f39f3014de475e4378ae474d41e3d6
parentUpdate to rails 2.3.8 & rack 1.1.0 (diff)
downloadrecruiting-webapp-1db84090103ca878d2d8977ceb6dda1f69afd1b2.tar.gz
recruiting-webapp-1db84090103ca878d2d8977ceb6dda1f69afd1b2.tar.bz2
recruiting-webapp-1db84090103ca878d2d8977ceb6dda1f69afd1b2.zip
Fix cucumber tests
Update to Rails 2.3.8 broke cucumber tests. This is fix from agibralter from https://gist.github.com/431811
-rw-r--r--config/environment.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/config/environment.rb b/config/environment.rb
index 5fc656d..02f8669 100644
--- a/config/environment.rb
+++ b/config/environment.rb
@@ -2,6 +2,22 @@ RAILS_GEM_VERSION = '2.3.8' unless defined? RAILS_GEM_VERSION
require File.join(File.dirname(__FILE__), 'boot')
+class RackRailsCookieHeaderHack
+ def initialize(app)
+ @app = app
+ end
+ def call(env)
+ status, headers, body = @app.call(env)
+ if headers['Set-Cookie'] && headers['Set-Cookie'].respond_to?(:collect!)
+ headers['Set-Cookie'].collect! { |h| h.strip }
+ end
+ [status, headers, body]
+ end
+end
+
Rails::Initializer.run do |config|
config.time_zone = 'UTC'
+ config.after_initialize do
+ ActionController::Dispatcher.middleware.insert_before(ActionController::Base.session_store, RackRailsCookieHeaderHack)
+ end
end