How do I write a spec for a Rails route that does redirecting?
- by winstonyw
I am using Omniauth in my Rails project, and I'll like to hide "/auth/facebook" behind a "/login" route.
In fact, I wrote a route:
match "/login", :to => redirect("/auth/facebook"), :as => :login
and this actually works, i.e. a link to login_path will redirect to /auth/facebook.
However, how can I write a (rspec) spec to test this route (specifically, the "redirect" option)?
Do note that /login is not an actual action nor method defined in application.
Thanks in advance!