Set user agent for rspec controller tests
In controller specs, you can just modify the Rack environment before making your request:
request.env['HTTP_USER_AGENT'] = 'Googlebot'
get :index
Written by Troy Martin
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Rspec
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#