Take the 2-minute tour ×

I have the following in Rspec

response.should redirect_to %r{\A/my_settings/mysub_path/}

I get the following error

NoMethodError: undefined method `model_name' for Regexp:Class

I just need to match a part of my path which contains my_settings/mysub_path. How is this achieved in rspec?

share|improve this question
add comment

1 Answer

redirect_to expects a string or an active record model.

if you want to match something, you can use response.location

share|improve this answer
add comment

Your Answer


