vendredi 22 janvier 2016

Different values from root_url with RSpec

I have a controller spec in which I test the responses I get from my controller. My response should have a link that is formed like so:

root_url + 'some_image.png'

That is how I form the link in the decorator.

My problem is that in my spec when I create the expected response body it gets the URL as this:

http://ift.tt/1Jrn7xu

But the actual response I get from the controller is as this:

http://ift.tt/1Jrn7xw

I think this is because the controller request stubs out the root_url to this, but in the actual spec code it doesn't

I tried to stub the root_url method with no luck, how I can fix this issue?

Aucun commentaire:

Enregistrer un commentaire