Skip to content

Commit 1dd505f

Browse files
y-kimura-39raJen Weber
authored andcommitted
Fixed wrong diffs in Tutorial (#146)
1 parent e4eb7cb commit 1dd505f

File tree

6 files changed

+15
-17
lines changed

6 files changed

+15
-17
lines changed

guides/v3.4.0/tutorial/acceptance-test.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ To do that, replace occurrences of `/list-rentals` in the generated test with `/
4545

4646
```javascript {data-filename="tests/acceptance/list-rentals-test.js" data-diff="-8,+9,-10,+11,-12,+13"}
4747
import { module, test } from 'qunit';
48-
import { setupApplicationTest } from 'ember-qunit';
4948
import { visit, currentURL } from '@ember/test-helpers';
49+
import { setupApplicationTest } from 'ember-qunit';
5050

5151
module('Acceptance | my acceptance test', function(hooks) {
5252
setupApplicationTest(hooks);

guides/v3.4.0/tutorial/autocomplete-component.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ which allows a Handlebars template to be rendered _inside_ the component's templ
2424

2525
In this case we are passing, or "yielding", our filter data to the inner markup as a variable called `filteredResults` (line 14/).
2626

27-
```handlebars {data-filename="app/templates/rentals.hbs" data-diff="+12,+13,+14,+15,+16,+17,+18,+19,+20,-21,-22,-23"}
27+
```handlebars {data-filename="app/templates/rentals.hbs" data-diff="+12,+13,+14,+15,+16,+17,+18,+19,+20,+21,-22,-23,-24"}
2828
<div class="jumbo">
2929
<div class="right tomster"></div>
3030
<h2>Welcome!</h2>
@@ -45,6 +45,7 @@ In this case we are passing, or "yielding", our filter data to the inner markup
4545
{{/each}}
4646
</ul>
4747
{{/list-filter}}
48+
{{outlet}}
4849
{{#each model as |rentalUnit|}}
4950
{{rental-listing rental=rentalUnit}}
5051
{{/each}}

guides/v3.4.0/tutorial/installing-addons.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Our primary focus with mirage will be in the `config.js` file, which is where we
5656
We will be following the [JSON-API specification](http://jsonapi.org/) which requires our data to be formatted a certain way.
5757
Let's configure Mirage to send back our rentals that we had defined above by updating `mirage/config.js`:
5858

59-
```javascript {data-filename="mirage/config.js" data-diff="+1,+2,+3,+4,+5,+6,+7,+8,+9,+10,+11,+12,+13,+14,+15,+16,+17,+18,+19,+20,+21,+22,+23,+24,+25,+26,+27,+28,+29,+30,+31,+32,+33,+34,+35,+36,+37,+38,+39,+40,+41,+42,-43,-44,-45,-46,-47,-48,-49,-50,-51,-52,-53,-54,-55,-56,-57,-58,-59,-60,-61,-62,-63,-64,-65,-66,-67"}
59+
```javascript {data-filename="mirage/config.js" data-diff="+1,+2,+3,+4,+5,+6,+7,+8,+9,+10,+11,+12,+13,+14,+15,+16,+17,+18,+19,+20,+21,+22,+23,+24,+25,+26,+27,+28,+29,+30,+31,+32,+33,+34,+35,+36,+37,+38,+39,+40,+41,+42,+43,+44,+45,-46,-47,-48,-49,-50,-51,-52,-53,-54,-55,-56,-57,-58,-59,-60,-61,-62,-63,-64,-65,-66,-67,-68,-69,-70"}
6060
export default function() {
6161
this.namespace = '/api';
6262

@@ -71,7 +71,8 @@ export default function() {
7171
city: 'San Francisco',
7272
category: 'Estate',
7373
bedrooms: 15,
74-
image: 'https://upload.wikimedia.org/wikipedia/commons/c/cb/Crane_estate_(5).jpg'
74+
image: 'https://upload.wikimedia.org/wikipedia/commons/c/cb/Crane_estate_(5).jpg',
75+
description: "This grand old mansion sits on over 100 acres of rolling hills and dense redwood forests."
7576
}
7677
}, {
7778
type: 'rentals',
@@ -82,7 +83,8 @@ export default function() {
8283
city: 'Seattle',
8384
category: 'Condo',
8485
bedrooms: 1,
85-
image: 'https://upload.wikimedia.org/wikipedia/commons/0/0e/Alfonso_13_Highrise_Tegucigalpa.jpg'
86+
image: 'https://upload.wikimedia.org/wikipedia/commons/0/0e/Alfonso_13_Highrise_Tegucigalpa.jpg',
87+
description: "A commuters dream. This rental is within walking distance of 2 bus stops and the Metro."
8688
}
8789
}, {
8890
type: 'rentals',
@@ -93,9 +95,10 @@ export default function() {
9395
city: 'Portland',
9496
category: 'Apartment',
9597
bedrooms: 3,
96-
image: 'https://upload.wikimedia.org/wikipedia/commons/f/f7/Wheeldon_Apartment_Building_-_Portland_Oregon.jpg'
98+
image: 'https://upload.wikimedia.org/wikipedia/commons/f/f7/Wheeldon_Apartment_Building_-_Portland_Oregon.jpg',
99+
description: "Convenience is at your doorstep with this charming downtown rental. Great restaurants and active night life are within a few feet."
97100
}
98-
}]
101+
}];
99102
};
100103
});
101104
}

guides/v3.4.0/tutorial/model-hook.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,6 @@ To find the elements that have a class called `listing`, we'll use the method [`
113113
The `querySelectorAll` method returns the elements that match the given [CSS selector](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors).
114114
In this case it will return an array of all the elements with a class called `listing`.
115115

116-
```javascript {data-filename="tests/acceptance/list-rentals-test.js" data-diff="+4"}
117-
import {
118-
click,
119-
currentURL,
120-
visit
121-
} from '@ember/test-helpers'
122-
```
123-
124116
```javascript {data-filename="tests/acceptance/list-rentals-test.js" data-diff="+2,+3"}
125117
test('should list available rentals.', async function(assert) {
126118
await visit('/');

guides/v3.4.0/tutorial/routes-and-templates.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,9 @@ Some of the helpers we'll use commonly are:
335335

336336
Let's import these helpers into our application test:
337337

338-
```javascript {data-filename=/tests/acceptance/list-rentals-test.js}
338+
```javascript {data-filename="tests/acceptance/list-rentals-test.js" data-diff="-1,+3,+4,+5,+6,+7"}
339+
import { visit, currentURL } from '@ember/test-helpers';
340+
import { setupApplicationTest } from 'ember-qunit';
339341
import {
340342
click,
341343
currentURL,

guides/v3.4.0/tutorial/service.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ Now implement the service as follows.
115115
Note that we check if a map already exists for the given location and use that one,
116116
otherwise we call a Google Maps utility to create one.
117117

118-
```javascript {data-filename="app/services/maps.js" data-diff="+2,+3,+5,+9,+10,+11,+12,+13,+14,+15,+16,+17,+19+,+20,+21,+22,+23,+24,+25,+26,+27,+28,+30,+31,+32,+33,+34"}
118+
```javascript {data-filename="app/services/maps.js" data-diff="+2,+3,+5,+9,+10,+11,+12,+13,+14,+15,+16,+17,+19,+20,+21,+22,+23,+24,+25,+26,+27,+28,+30,+31,+32,+33,+34"}
119119
import Service from '@ember/service';
120120
import { camelize } from '@ember/string';
121121
import EmberObject from '@ember/object';

0 commit comments

Comments
 (0)