Skip to content

Instantly share code, notes, and snippets.

@ryanlabouve
Created April 14, 2016 06:30
Show Gist options
  • Select an option

  • Save ryanlabouve/c86bcfd1956a04d6d4f0c226528ce44b to your computer and use it in GitHub Desktop.

Select an option

Save ryanlabouve/c86bcfd1956a04d6d4f0c226528ce44b to your computer and use it in GitHub Desktop.
import { test } from 'qunit';
import moduleForAcceptance from 'esa-debug/tests/helpers/module-for-acceptance';
import {
authenticateSession,
} from 'esa-debug/tests/helpers/ember-simple-auth';
moduleForAcceptance('Acceptance | login');
test('visiting /login', function(assert) {
visit('/login');
andThen(function() {
assert.equal(currentURL(), '/login');
});
});
test('cannot visit projects if not login', function(assert) {
visit('/projects');
andThen(function() {
assert.equal(currentURL(), '/login');
});
});
test('visiting /projects', function(assert) {
authenticateSession(this.application);
visit('/projects');
andThen(function() {
// assert.equal(currentSession(application).get('isAuthenticated'), true)
assert.equal(currentURL(), '/projects');
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment