Hi,
Im trying to test the following method:
def notice
65 userAgent = request.env[‘HTTP_USER_AGENT’]
66
67 if userAgent.index(‘MSIE 7.0;’) != nil
68 @ie7 = true
69 elsif userAgent.index(‘MSIE 6.0;’) != nil
70 @ie6 = true
71 end
72
73 if (@ie6)
74 render :action=> “notice”, :layout => false
75 else
76 redirect_to :controller => “home”, :action => “index”
77 end
78 end
the problem im having is that i cant seem to find a way of setting the
user agent before it goes into the method and checks the type of browser
being used.
im sure this is something trivial involving a mock but its just proving
to be a bit illusive to me
Cheers,
Chris