context "No user logged in" do
it "redirects to login" do
get :show, id: @user.id
expect(response).to redirect_to("/login")
end
end
end
端 不确定哪里出错
答案 0 :(得分:0)
我有同样的问题,我用这个
修复了 response = get :show, id: @user.id
p response.body
expect(response.body).to eql(#HERE THE BODY OF YOUR RESPONSE)