嗨,我刚才在这期杂志上发表过。。。
authlogic flash[:notice] does not show up in cucumber webrat step
看起来它仍然存在于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中,我不能在中间件中注入一些东西
根据灯塔追踪器,这应该被修复。。。有人能确认这个问题仍然存在于轨道3吗?有什么帮助吗?