abuiles / ember-cli-101-errata

18 stars 4 forks source link

HTTP-mock for testing is not recommended? #163

Closed IanVS closed 9 years ago

IanVS commented 9 years ago

I spent a lot of time figuring out http-mock, and got to the point where I can populate a fake friend and fake article. However, the acceptance test for creating a new friend is failing, likely because the proper response is not being faked. As I tried to figure that out, I came across this issue: https://github.com/ember-cli/ember-cli/issues/1763 which seems to indicate that Pretender is the suggested way of testing. It would be awesome if you could add some discussion in the book about when it is appropriate to use the different methods, and the pros/cons to each. The reason you bring it up in the book is to prevent calls to the actual API creating new friends, but as it stands I can't figure out how to get the tests to pass by using mocks. Maybe you could flesh it out a little? Thanks!

abuiles commented 9 years ago

@IanVS thanks Ian!

Sure thing, I'll leave this open for now until I do something about it.