Skip to content

Commit c7d7907

Browse files
committed
Rebase with master, move examples into pods
1 parent dab3a8b commit c7d7907

8 files changed

Lines changed: 522 additions & 434 deletions

File tree

addon-test-support/-private/mock-server.js

Whitespace-only changes.
File renamed without changes.

tests/dummy/app/templates/load-data-post.hbs renamed to tests/dummy/app/pods/examples/network/get/template.hbs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,3 @@ The data loaded from the server is:
55
{{post.title}}
66
</div>
77
{{/each}}
8-
9-
10-
model: {{model}}
File renamed without changes.

tests/dummy/app/templates/load-data.hbs renamed to tests/dummy/app/pods/examples/network/post/template.hbs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,3 @@ The data loaded from the server is:
55
{{post.title}}
66
</div>
77
{{/each}}
8-
9-
10-
model: {{model}}

tests/dummy/app/router.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,10 @@ Router.map(function() {
2727

2828
this.route('request-object');
2929

30-
this.route('load-data');
31-
this.route('load-data-post');
30+
this.route('network', function() {
31+
this.route('post');
32+
this.route('get');
33+
});
3234

3335
this.route('errors', function() {
3436
this.route('throw-message');
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,28 @@
11
import { module, test } from 'qunit';
22
import { setup, visit, mockServer } from 'ember-cli-fastboot-testing/test-support';
33

4-
module('Fastboot | mock', function(hooks) {
4+
module('Fastboot | network mocking', function(hooks) {
55
setup(hooks);
66

7-
hooks.beforeEach(async function() {
8-
await mockServer.get('/api/')
9-
10-
});
11-
127
test('it can mock a get request', async function(assert) {
138
await mockServer.get('/api/posts', [
149
{ id: 1, title: 'test post'},
1510
{ id: 2, title: 'test 2'},
1611
]);
1712

18-
await visit('/load-data');
19-
20-
await this.pauseTest();
13+
await visit('/examples/network/get');
2114

2215
assert.dom('[data-test-id="title-1"]').hasText("test post")
16+
assert.dom('[data-test-id="title-2"]').hasText("test 2")
2317
});
2418

2519
test('it can mock a post request', async function(assert) {
2620
await mockServer.post('/api/posts', [
2721
{ id: 1, title: 'post post'},
2822
]);
2923

30-
await visit('/load-data-post');
24+
await visit('/examples/network/post');
3125

3226
assert.dom('[data-test-id="title-1"]').hasText("post post")
3327
});
34-
35-
test('')
3628
});

0 commit comments

Comments
 (0)