0
對於檢測和響應移動用戶代理,我使用的測試。移動與水豚MIME格式/ rspec的
Mime::Type.register_alias "text/html", :mobile
和方法我想知道什麼是與水豚測試的最佳方法。這篇文章建議設立一個iphone驅動程序Capybara.register_driver :iphone do |app|
http://blog.plataformatec.com.br/2011/03/configuring-user-agents-with-capybara-selenium-webdriver/
但我想在那裏MIME類型是通過URL擴展
localhost/index.mobile
設置更靈活的方式,並在那裏我可以做這
visit user_path(format: :mobile)
Rails的理解延伸,並設置format
在params
散列,但我如何獲得URL助手方法將其作爲文件擴展名添加到所有網址?
答案就在這裏 - http://railscasts.com/episodes/199-mobile-devices所以我會回答我自己的問題。 –