Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何访问session请求规范中的哈希内容?
session
这(只是使用session[:key])给了我未定义的方法:
session[:key]
RSpec spec_helper 访问会话变量
检查您是否在正确的上下文中调用会话方法。您可以在它指定之前的方法块中调用它。
例子:
it "should reset session[:auth_by_github]" do session[:auth_by_github].should eql(nil) end