我有以下系统测试(Rails 后端、React/Redux 前端单页应用程序):
test "can sign up user properly" do
visit '/'
within ('.signup-form-box') do
fill_in 'Username', with:'userp'
fill_in "Email Address", with: "t!"
fill_in "Password", with: "12345679"
click_on "Sign Up"
end
assert page.current_path == '/books'
end
它应该在成功注册后将用户引导到“/books”页面。然而这个测试失败了。当我将断言更改为:
assert page.current_path == '/'
它通过了。检查这类事情的正确方法是什么?