I have some functionality in a rails 3.2 app that needs to be driven by the user's USER_AGENT. Basically, for certain older browsers I need to have the pages render differently.
How can I test that my views respond correctly using using capybara / cucumber?
I saw this post but it doesn't look like it works with the lastest capybara -- it basically hacks the way capybara stubs environmental parameters:
http://blog.sparqcode.com/2011/03/07/custom-user-agent-strings-with-cucumber-and-capybara/
What I'd like is a cucumber step definition that looks something like this:
When /^I visit the page with an unsupported browser$/ do
user_agent = "Mozilla/5.0 (X11; U; Linux i686; pl-PL; rv:1.9.0.2) Gecko/2008092313 Ubuntu/9.25 (jaunty) Firefox/3.8"
# do something here that mimics the user arriving on the page with this USER_AGENT
end