1
我正在使用水豚进行集成测试,它看起来有点不对劲,因为会话被传递给我的控制器以用于我的“登录”部分测试。登录通过浏览器正常工作,但在水豚中失败。Rails会话不正确?
def integration_sign_in(user)
visit signin_path
puts "Pre email: " + user.email
puts "Pre password: " + user.password
# When I use these, everything works correctly
fill_in "session_email", :with => user.email
fill_in "session_password", :with => user.password
# When I use these, the session is wrong
# The params[:session][:email] on the server has the password field
# The params[:session][:password] on the server is nil
#fill_in :email, :with => user.email
#fill_in :password, :with => user.password
click_button "Sign in"
end
我不能使用水豚测试的符号吗?我的猜测是,第一个字段(电子邮件)正在填补为失败案件的两个领域,这就是为什么会话只有一个电子邮件的价值,而该值是密码。