How do I test a redirect in sinatra using rspec?
문제
I'm trying to test for a redirect on the homepage in my sinatra app (more specifically, a padrino app), in rspec. I've found redirect_to
, however it seems to be in rspec-rails only. How do you test for it in sinatra?
So basically, I'd like something like this:
it "Homepage should redirect to locations#index" do
get "/"
last_response.should be_redirect # This works, but I want it to be more specific
# last_response.should redirect_to('/locations') # Only works for rspec-rails
end
올바른 솔루션이 없습니다
제휴하지 않습니다 StackOverflow