嗨,我前一阵子跑过这个问题...
authlogic flash[:notice] 没有出现在黄瓜 webrat 步骤中
看起来它仍然存在于 rails 3 中,这是一个建议的修复。
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
config.after_initialize do
ActionController::Dispatcher.middleware.insert_before(ActionController::Base.session_store, RackRailsCookieHeaderHack)
end
这解决了 2.3.8 的问题...我必须将它放在 config/environment/cucumber.rb
但是在 Rails 3 中这个文件不再可用,并且在 config/environment/test.rb 我不能在中间件中注入一些东西
根据灯塔错误跟踪器,这应该被修复......有人可以确认Rails 3仍然存在这个问题吗?任何帮助都会很棒?