[rspec-users] what would be the best way to stub out an XHR request's response?

Patrick J. Collins patrick at collinatorstudios.com
Wed Sep 26 18:26:19 UTC 2012


> I would just wrap the method that makes the ajax call and spec it from
> Jasmine. Then you can just stub the wrapper to return the data you
> want and expect the right thing to happen in the callback method (or
> however the data gets stored/displayed.)

Sorry, I am not sure if I am understanding you correctly...  Are you
saying, in the test environment, load jasmine via <script> tags, and use
it to stub out the method that call that does the ajax call?


Patrick J. Collins
http://collinatorstudios.com


More information about the rspec-users mailing list