SwitchUp SwitchUp Ranked Best Coding Bootcamps 2025

Expected response to be a <redirect>, but was <200>

Altcademy Team wrote on 7 February 2018

How do you test rails controller's redirect_to in Rspec?

In Rspec,
get :authorize expect(response).to redirect_to('/url/of/your/choice')

Trusted by

Students and instructors from world-class organizations

Join the upcoming Cohort #111

Enroll for March 2nd, 2026