I am using an alternate style sheet for printing, loading it via
<%= stylesheet_link_tag ‘print’, :media => :print %>
which is working as expected.
The problem is with testing, I would like to test that the layout is working correctly, in my controller functional tests, but I cannot see how to do this as, if I understand correctly, the style sheet selection change is made by the browser. I can check, for example, that items to be hidden are enclosed in divs of the appropriate class so that they should be hidden, but I cannot check that they actually will be hidden when printing. Is there any way to do this?
Any suggestions will be appreciated.