1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- import Ember from 'ember';
- import { module, test } from 'qunit';
- import startApp from '../helpers/start-app';
- var application;
- module('Acceptance: TermsOfService', {
- beforeEach: function() {
- application = startApp();
- },
- afterEach: function() {
- Ember.run(application, 'destroy');
- Ember.$.mockjax.clear();
- }
- });
- test('visiting unset /terms-of-service', function(assert) {
- Ember.$.mockjax({
- url: "/api/legal-pages/terms-of-service/",
- status: 404,
- responseText: {'detail': 'Not found'}
- });
- visit('/terms-of-service');
- andThen(function() {
- assert.equal(currentPath(), 'error-404');
- });
- });
- test('visiting set /terms-of-service', function(assert) {
- Ember.$.mockjax({
- url: "/api/legal-pages/terms-of-service/",
- status: 200,
- responseText: {
- 'id': 'terms-of-service',
- 'title': 'Terms of service',
- 'link': '',
- 'body': '<p>Top kek</p>'
- }
- });
- visit('/terms-of-service');
- andThen(function() {
- assert.equal(currentPath(), 'terms-of-service');
- var $e = find('article');
- assert.equal(Ember.$.trim($e.html()), '<p>Top kek</p>');
- });
- });
|