import Ember from 'ember'; import { module, test } from 'qunit'; import startApp from '../helpers/start-app'; var application; module('Acceptance: PrivacyPolicy', { beforeEach: function() { application = startApp(); }, afterEach: function() { Ember.run(application, 'destroy'); Ember.$.mockjax.clear(); } }); test('visiting unset /privacy-policy', function(assert) { assert.expect(1); Ember.$.mockjax({ url: '/api/legal-pages/privacy-policy/', status: 404, responseText: {'detail': 'Not found'} }); visit('/privacy-policy'); andThen(function() { assert.equal(currentPath(), 'error-404'); }); }); test('visiting set /privacy-policy', function(assert) { assert.expect(2); Ember.$.mockjax({ url: '/api/legal-pages/privacy-policy/', status: 200, responseText: { 'id': 'privacy-policy', 'title': 'Privacy policy', 'link': '', 'body': '
Privacy policy is working!
' } }); visit('/privacy-policy'); andThen(function() { assert.equal(currentPath(), 'privacy-policy'); var $e = find('article'); assert.equal(Ember.$.trim($e.html()), 'Privacy policy is working!
'); }); });