Created
November 6, 2015 09:57
-
-
Save thijsvdanker/891cdf85e1066e69682d to your computer and use it in GitHub Desktop.
Visiting two routes that require authentication in an acceptance test only redirects once.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
import { module, test } from 'qunit'; | |
import startApp from 'APP_NAME/tests/helpers/start-app'; | |
module('Acceptance | authenticated routes', { | |
beforeEach: function() { | |
this.application = startApp(); | |
}, | |
afterEach: function() { | |
Ember.run(this.application, 'destroy'); | |
} | |
}); | |
test('Unauthenticated users can not visit routes that require authentication', function(assert) { | |
// When I visit a protected route. | |
visit('/protected-route'); | |
andThen(function() { | |
// Then I get redirected to the login page. | |
assert.equal(currentURL(), '/login'); | |
}); | |
// When I visit it again. | |
visit('/protected-route'); | |
andThen(function() { | |
// Then I get still get redirected to the login page. | |
assert.equal(currentURL(), '/login'); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello Thijs,
I found this issue that you submitted
mainmatter/ember-simple-auth#769
Almost a year later I have the same problem:
Did you resolve this? / What did you do?
gr. Marco