mainmatter / ember-simple-auth

A library for implementing authentication/authorization in Ember.js applications.
https://ember-simple-auth.com
MIT License
1.92k stars 603 forks source link

Testing? #47

Closed brandonparsons closed 10 years ago

brandonparsons commented 10 years ago

How exactly do you go about testing this within an Ember app?

Is there a way to fake server calls, or just force it to log in with fake data?

marcoow commented 10 years ago

See the integration tests in this example app: https://github.com/ugisozols/ember-simple-auth-rails-demo. Of course you could also mock AJAX responses with e.g. sinon or so. For e.g. routes unit tests I think it's best to simple setup a session with fake data to authenticate the session for testing, see http://ember-simple-auth.simplabs.com/api.html#Ember-SimpleAuth-Session-setup.

Also please ask questions like this on stack overflow. GitHub should really only be used for issues.