I have the following system test (Rails backend, React/Redux frontend single-page application):
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
Its supposed to lead the user to the '/books' page after a successful signup. However this test fails. When i change the assertion to :
assert page.current_path == '/'
it passes. What is the proper way to check this sort of thing?