• 我也在跟着 Rails Tutorial 学习,出现这个情况是因为测试中用了get/post/patch/put,cookie 带不过去,如:

    before { get edit_user_path(wrong_user) }
    

    如果换成 visit,cookie 就能带过去,就不会redirect_to signin_url了,但具体我也说不清,仅供参考。