0

I have an app that uses ember-simple-auth for Google authentication. All requests to my PHP backend are authorized with a Google access token, which the backend checks with Google before doing anything else. I understand ember-simple-auth has a testing package, but how would I go about testing this app?

The backend is a part of the app's repository, under app/api/.

An approach would be to customise the PHP code depending on the environment (importing config/environment.js), but it's on the backend and it's written in PHP.

Jonathan Chan
  • 354
  • 2
  • 12

1 Answers1

0

You don't want your ember cli tests to depend on the backend so you can simply use ember-simple-auth-testing which will give you a readily authenticated session without interacting with the server at all.

marcoow
  • 4,062
  • 1
  • 14
  • 21
  • How would I test authentication and authorisation? – Jonathan Chan Jul 10 '15 at 14:15
  • Usually you have separate tests for the client and the server that both mock out the other side. You could setup integration tests as well that test both systems together but that's usually pretty difficult to maintain. Also I'm not aware of any standard tool for that. – marcoow Jul 10 '15 at 14:57
  • Would you recommend putting them in the same repository then? – Jonathan Chan Jul 11 '15 at 03:48
  • No, don't put your server and client in one repo. Your client project will be an Ember CLI project while the server project might be rails or so - 2 completely different structures. Also the client and server shouldn't directly depend on each other anyways. – marcoow Jul 13 '15 at 10:08