我刚刚用这样的工厂女孩设置了 Pickle (features/support/pickle.rb):
Pickle.configure do |config|
config.adapters = [:factory_girl]
config.map 'I', 'myself', 'me', 'my', :to => 'user: "me"'
end
我现在想开始一个这样的黄瓜场景:
Given a journal exists with user: me
这样它就创建了一个以当前用户为 user_id 的日志模型实例,但我收到此错误:
Pickle::Session::ModelNotKnownError: The model: 'user: "me"' is not known in this
scenario. Use #create_model to create, or #find_model to find, and store a reference
in this scenario.
如何让 Pickle 将“我”与 current_user 匹配?错误消息中的提示没有告诉我如何或在哪里存储它。
nb 我所做的登录步骤已经将当前用户存储在@me