mercredi 11 novembre 2015

Ember.RSVP.hash and acceptance testing

I have a hash that's called from a service:

return new Ember.RSVP.hash({
    locations: ajax(
      {
            url: applicationConfig.apiUrl + '/api/v1/locations/search?term=' + term
      }),
    listingEvents: ajax({
            url: applicationConfig.apiUrl + '/api/v1/listingevents/search?term=' + term 
      })
  });

Now in my tests I am getting:

✘ Error: Assertion Failed: You have turned on testing mode, which disabled the run-loop's autorun.
                  You will need to wrap any code with asynchronous side-effects in a run

I have wrapped the hash in an Ember.run but that doesn't work.

What is the best way to get the hash to run in acceptance tests?

Aucun commentaire:

Enregistrer un commentaire