Пример #1
0
test('authenticated user gets redirected to dashboard', (assert)=>{
  assert.expect(1);

  window.localStorage.setItem('authToken', 'cramcram');
  Api.getMe();
  Api.getCardsets();
  visit('/');
  andThen(function() {
    assert.equal(currentURL(), '/dashboard');
  });
});
Пример #2
0
test('authenticated user goes to dashboard', (assert)=> {
  assert.expect(2);
  window.localStorage.setItem('authToken', 'cramcram');
  Api.getMe();
  Api.getCardsets();

  visit('/dashboard');

  andThen(function() {
    assert.equal(currentURL(), '/dashboard');
    textEqual(assert, 'h2', 'My Sets', 'Title text correct' );
  });
});