Closed
Description
Hi,
I had a spec working under Rails 4 / Rspec 3.4.4 that looked like this:
it 'does something with the referrer' do
allow(request).to receive(:referrer).and_return('aol.com')
expect(Foo).to receive(:bar).with('aol.com')
get :endpoint
end
After upgrading, it looks like request.referrer
is not stubbed correctly and request.referrer
in the controller returns nil
.
I tried rewriting like so:
get :endpoint, { params: {} }, headers: { 'HTTP_REFERER' => 'aol.com' }
But I wasn't able to get that header, or actually any header passed through to the controller.
Any suggestions?