Unit tests and mock objects with Oil extension

yung.melissa's Avatar

yung.melissa

15 Jul, 2013 01:05 PM

Hello

I am trying to write some unit tests for my application in which I am using the Oil extension.
My application follows the examples described in the first secion Async Promise here
https://github.com/darscan/robotlegs-extensions-Oil

But how do I go about writing unit test when I want to test if my model reacts accordingly given a set of various data returned from my service? How would I create that mock service object making the mock callback that my model is waiting on?

I saw examples when there is an actual immediate return value but that was not really applicable to my case (as far as I understood anyway)

Hoping I'm on the right track at least.
Thanks for your help!

  1. Support Staff 1 Posted by creynders on 16 Jul, 2013 10:29 AM

    creynders's Avatar

    I responded to your SO question instead, since it provided more info.

  2. 2 Posted by yung.melissa on 16 Jul, 2013 10:34 AM

    yung.melissa's Avatar

    Thanks! :)

  3. Support Staff 3 Posted by creynders on 16 Jul, 2013 01:51 PM

    creynders's Avatar

    Glad it helped!

  4. creynders closed this discussion on 16 Jul, 2013 01:51 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac