I'm writing an rspec test which fails at line
if URI(request.referrer).path.include?('cart')
I want to be able to make the request.referrer include 'cart'
Please let me know if you have any approaches.
i tried the following and they didn't work:
@request.env['HTTP_REFERER']='http://localhost:port/account/cart/id'
post url, params
also tried:
post url, params, {"HTTP_REFERER" => "http://localhost:port/account/cart/id"}