Created
June 30, 2017 10:36
-
-
Save samselikoff/747f07b93fb0dfcc371233fbe3cb5941 to your computer and use it in GitHub Desktop.
This file contains 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 { test } from 'qunit'; | |
import moduleForAcceptance from 'ember-map/tests/helpers/module-for-acceptance'; | |
moduleForAcceptance('Acceptance | Topic'); | |
test('I should get redirected from /topics to videos.index', function(assert) { | |
visit('/topics'); | |
andThen(() => { | |
assert.equal(currentPath(), 'videos.index'); | |
}); | |
}); | |
test('As an unauthenticated user I should see a link in the hero that goes to subscribe', function(assert) { | |
let series = server.create('series', 'withClips'); | |
visit(`/topics/${series.slug}`); | |
click(testId('subscribe-link')); | |
andThen(() => { | |
assert.equal(currentPath(), 'subscribe.index'); | |
}); | |
}); | |
test('As an authenticated but unsubscribed user I should see a link in the hero that goes to subscribe', function(assert) { | |
loginUser(); | |
let series = server.create('series', 'withClips'); | |
visit(`/topics/${series.slug}`); | |
click(testId('subscribe-link')); | |
andThen(() => { | |
assert.equal(currentPath(), 'subscribe.index'); | |
}); | |
}); | |
test('As a subscribed user I should see a link in the hero to watch the first video', function(assert) { | |
let series = server.create('series', 'withClips'); | |
let user = loginUser(); | |
subscribeUser(user); | |
visit(`/topics/${series.slug}`); | |
click(testId('start-watching-link')); | |
andThen(() => { | |
assert.equal(currentPath(), 'topics.topic.video'); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment