gon icon indicating copy to clipboard operation
gon copied to clipboard

Controller path in integration testing with rspec not available

Open gazay opened this issue 11 years ago • 2 comments

https://github.com/gazay/gon/issues/43


Awesome, @gazay, thanks for the help! I've created a minimal app that reproduces the issue: [email protected]:KrisBraun/gon-rabl-rspec.git

Should be as simple as sync, bundle install, rspec, boom.


It's pretty clear what to do here - there not real request goes to gon from rspec - TestRequest goes. So there should be done some switch for env.test?.

gazay avatar Sep 23 '13 13:09 gazay

I do not find this easy to fix. From where should the controller instance come then if it is not available through TestRequest? This problem can always be solved from the caller side by simply requiring to pass the controller object:

gon.jbuilder template: 'path/to/template.json.jbuilder', controller: self

But otherwise, no clue…

konradreiche avatar Dec 11 '13 17:12 konradreiche

I have similar issue, may be it has same reason, described here #124 and how to temporary fix

cheef avatar Mar 31 '14 13:03 cheef