Skip to content

Commit cfbaed1

Browse files
committed
fix tests
1 parent ee63150 commit cfbaed1

3 files changed

Lines changed: 24 additions & 14 deletions

File tree

tests/acceptance/auth-test.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import Ember from 'ember';
22
import {module, test} from 'qunit';
33
import startApp from '../helpers/start-app';
4+
import { invalidateSession, authenticateSession } from '../helpers/ember-simple-auth';
45

56
var application;
67

@@ -16,7 +17,7 @@ module('Acceptance: Auth', {
1617
test('redirects to /login when I try to see content as not authenticated user', function(assert) {
1718
assert.expect(2);
1819

19-
invalidateSession();
20+
invalidateSession(application);
2021
visit('/');
2122

2223
andThen(function() {
@@ -33,10 +34,10 @@ test('redirects to /login when I try to see content as not authenticated user',
3334
test('shows content when I`m authenticated', function(assert) {
3435
assert.expect(1);
3536

36-
authenticateSession();
37+
authenticateSession(application, { id: 1 });
3738
visit('/');
3839

3940
andThen(function() {
4041
assert.equal(currentURL(), '/');
4142
});
42-
});
43+
});

tests/dummy/app/index.html

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,34 @@
33
<head>
44
<meta charset="utf-8">
55
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6-
<title>Dummy</title>
6+
<title>Dummy Tests</title>
77
<meta name="description" content="">
88
<meta name="viewport" content="width=device-width, initial-scale=1">
99

1010
{{content-for 'head'}}
11+
{{content-for 'test-head'}}
1112

1213
<link rel="stylesheet" href="assets/vendor.css">
1314
<link rel="stylesheet" href="assets/dummy.css">
15+
<link rel="stylesheet" href="assets/test-support.css">
1416
</head>
1517
<body>
1618
{{content-for 'body'}}
17-
19+
{{content-for 'test-body'}}
1820
<script src="assets/vendor.js"></script>
21+
<script src="assets/test-support.js"></script>
1922
<script src="assets/dummy.js"></script>
20-
<script src="http://api-maps.yandex.ru/2.0/?load=package.standard&lang=ru-Ru"></script>
21-
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&key=AIzaSyCqyf1CwoH9VU6XNYBmIXZSRsMQ0BJUOrw&libraries=places"></script>
23+
<script src="testem.js"></script>
24+
<script src="assets/test-loader.js"></script>
25+
<script type="text/javascript" charset="utf-8">
26+
Function.prototype.bind = Function.prototype.bind || function (thisp) {
27+
var fn = this;
28+
return function () {
29+
return fn.apply(thisp, arguments);
30+
};
31+
};
32+
</script>
33+
{{content-for 'body-footer'}}
34+
{{content-for 'test-body-footer'}}
2235
</body>
2336
</html>

tests/test-helper.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
import resolver from './helpers/resolver';
2-
import { setResolver } from 'ember-qunit';
2+
import {
3+
setResolver
4+
} from 'ember-qunit';
35

46
setResolver(resolver);
5-
6-
document.write('<div id="ember-testing-container"><div id="ember-testing"></div></div>');
7-
8-
QUnit.config.urlConfig.push({ id: 'nocontainer', label: 'Hide container'});
9-
var containerVisibility = QUnit.urlParams.nocontainer ? 'hidden' : 'visible';
10-
document.getElementById('ember-testing-container').style.visibility = containerVisibility;

0 commit comments

Comments
 (0)