Specs needed to be updated to handle new way of receiving methods.
What's more they revealed a subtle bug that was present after changing
merge function to fetch record if it's not present.
After calling merge, store calls method to update associations. This
may be not possible if clientId for new record is not correctly set.
Pusher events usually does not have all data that's needed and ember
will not automatically refresh record to load missing data. That's why
it's easier to fetch record information directly from API for the first
time, even if it comes from pusher.
Pusher events do not always have the entire data for given object.
That's why we need to merge incoming data instead of replacing
everything. Current implementation of merge is just modified version of
load function, so it will be best to either add it to Ember or make the
implementation less dependent on internals.
All of the repos without lastBuildFinishedAt had the same value for
sortOrder, which could result in 'jumps' on the list when loading new
data from the API.
It seems that store is not automatically cleaned when calling
app.destroy() as this is just regular property on app object.
Furthermore, there is a bug with connectOutlet that prevents cleaning
views that are set with it. I've added a small hack to save all the
views added as outlets to be able to clean them after running tests.
It seems that this is more reliable way to handle async waits. runs
block is executed only when first waitFor succeeds and then it waits for
next waitFor.
mockjax expects urls exactly as defined, so if you mock '/repos' it will
not match 'http://localhost:9292/repos'. If endpoint is undefined (like
in specs), we may just try to use path.
I'm not sure why, but this fixes a problem that occures in builds/show.
It's probably some kind of weird behavior that's happening when ember
manages views insterted with each as opposed to collection management.