mainmatter / ember-simple-auth-example

Example project showing how to use Ember Simple Auth with Ember CLI
30 stars 15 forks source link

Ephermal store doesn't seem to work for tests #2

Closed Bushjumper closed 10 years ago

Bushjumper commented 10 years ago

Hey there,

The session store seems to be shared between the development and test environments, even though you have store set to 'simple-auth-session-store:ephemeral' in your test environment.

Could you please confirm that you're seeing the same behaviour and let me know if there is a simple way to separate the session store between environments? I've had success with using the Ephemeral store in an Ember App Kit project with ember-simple-auth so it would be good to get it working for ember-cli.

Thanks!

marcoow commented 10 years ago

the localStorage store as well as the cookie store are shared between tabs/windows. The ephemeral store is not shared between tabs/windows though as it's in-memory and there is no shared memory between tabs/windows.

If you see the store being shared between development and test environment you're most likely not using the ephemeral store in the test environment - maybe you got the configuration wring somehow.

Bushjumper commented 10 years ago

Marco, thanks for the quick response.

I haven't changed the example repo. If I open the app in one tab and the tests in another the session seems to be shared between them - logging into the app breaks the tests. It doesn't seem as if the Ephemeral store is being enabled as expected. Is there another setup step needed to enable to Ephemeral store or are you seeing that same behaviour?

marcoow commented 10 years ago

You have to enable the ephemeral storage for the test ENV as described here: http://log.simplabs.com/post/92824729750/testing-with-ember-simple-auth-and-ember-cli

Am 11.08.2014 um 13:11 schrieb Graeme Longman notifications@github.com:

Marco, thanks for the quick response.

I haven't changed the example repo. If I open the app in one tab and the tests in another the session seems to be shared between them - logging into the app breaks the tests. It doesn't seem as if the Ephemeral store is being enabled as expected. Is there another setup step needed to enable to Ephemeral store or are you seeing that same behaviour?

— Reply to this email directly or view it on GitHub.

marcoow commented 10 years ago

Can this be closed then?

Bushjumper commented 10 years ago

Yes. The problem for me was that I assumed /tests would run in the same way as in Ember App Kit but I needed to run a dedicated test server to prevent the storage being shared between the test and development environments.