#excerpt
subject { response }
its(:response_code){ should eq 401 }
it { should redirect_to '/sign_in' }
返回:
Failures:
1) UsersController GET #edit when not signed in should redirect to "/sign_in"
Failure/Error: it { should redirect_to '/sign_in' }
Expected response to be a <redirect>, but was <401>
我认为401是重定向?或者rspec的redirect_to方法是否专门寻找302?