Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misc. typo fixes #265

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1663,7 +1663,7 @@ Usage:
profile.save() //=> will fail
````

*mocking a failed update and retry with succees*
*mocking a failed update and retry with success*

```javascript
let profile = make('profile');
Expand All @@ -1689,7 +1689,7 @@ Usage:

##### mockDelete
- Need to wrap tests using mockDelete with: Ember.run(function() { 'your test' })
- To handle deleteing a model
- To handle deleting a model
- Pass in a record ( or a typeName and id )

Usage:
Expand Down Expand Up @@ -1739,8 +1739,8 @@ Usage:
##### Tips and Tricks

###### Tip 1: Fun with makeList/buildList and traits
- This is probably the funnest thing in FactoryGuy, if your not using this
syntax yet, you are truely missing out.
- This is probably the funnest thing in FactoryGuy, if you're not using this
syntax yet, you are truly missing out.

```javascript

Expand All @@ -1765,7 +1765,7 @@ Usage:
// app/serializers/person.js
export default DS.RESTSerializer.extend({

// let's say your modifying all names to be Japanese honorific style
// let's say you're modifying all names to be Japanese honorific style
serialize: function(snapshot, options) {
var json = this._super(snapshot, options);

Expand Down
6 changes: 3 additions & 3 deletions addon/builder/fixture-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,15 @@ export default class {
@returns {{}} JSONAPI formatted errors
*/
convertResponseErrors(object) {
let jsonAPIErrrors = [];
let jsonAPIErrors = [];
Ember.assert('[ember-data-factory-guy] Your error response must have an errors key. The errors hash format is: {errors: {name: ["name too short"]}}', object.errors);
let errors = object.errors;
for (let key in errors) {
let description = Ember.typeOf(errors[key]) === "array" ? errors[key][0] : errors[key];
let source = { pointer: "data/attributes/" + key };
let newError = { detail: description, title: "invalid " + key, source: source };
jsonAPIErrrors.push(newError);
jsonAPIErrors.push(newError);
}
return { errors: jsonAPIErrrors };
return { errors: jsonAPIErrors };
}
}
8 changes: 4 additions & 4 deletions addon/converter/fixture-converter.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ import Ember from 'ember';

If there are associations in the base fixture, they will be added to the
new fixture as 'side loaded' elements, even if they are another json payload
built whith the build/buildList methods.
built with the build/buildList methods.

@param {DS.Store} store
@param {Object} options
transformKeys tranform keys and values in fixture if true
transformKeys transform keys and values in fixture if true
serializeMode act like serialization is for a return to server if true
@constructor
*/
Expand All @@ -36,7 +36,7 @@ export default class {
/**
Convert an initial fixture into a final payload.
This raw fixture can contain other json in relationships that were
built by FacoryGuy ( build, buildList ) methods
built by FactoryGuy ( build, buildList ) methods

@param modelName
@param fixture
Expand All @@ -62,7 +62,7 @@ export default class {
}

/**
Empty respose is a special case, so use this method for generating it.
Empty response is a special case, so use this method for generating it.

@param _
@param {Object} options useValue to override the null value that is passed
Expand Down
2 changes: 1 addition & 1 deletion addon/converter/jsonapi-fixture-converter.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class JSONAPIFixtureConverter extends Converter {
}

/**
* JSONAPIerializer does not use modelName for payload key,
* JSONAPISerializer does not use modelName for payload key,
* and just has 'data' as the top level key.
*
* @param modelName
Expand Down
2 changes: 1 addition & 1 deletion addon/converter/rest-fixture-converter.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default class extends JSONFixtureConverter {
}

/**
* RESTSerializer has a paylaod key
* RESTSerializer has a payload key
*
* @param modelName
* @param fixture
Expand Down
4 changes: 2 additions & 2 deletions addon/mocks/exposed-request-functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export function mockReload(...args) {
let mockFindAll = mockFindAll('user').returns({json});

store.findAll('user').then(function(users){
// 2 users, fisrt with whacky name, second isDude
// 2 users, first with whacky name, second isDude
});
```

Expand Down Expand Up @@ -284,7 +284,7 @@ export function mockQueryRecord(modelName, queryParams) {
2) If you match on a belongsTo association, you don't have to include that in the
returns hash either.

@param {String} modelName name of model your creating like 'profile' for Profile
@param {String} modelName name of model you're creating like 'profile' for Profile
*/
export function mockCreate(modelName) {
Ember.assert(`[ember-data-factory-guy] mockCreate requires at least a model type name`, modelName);
Expand Down
2 changes: 1 addition & 1 deletion addon/mocks/mock-create-request.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default class MockCreateRequest extends AttributeMatcher(MockRequest) {
}

/**
This mock might be callled a few times in a row so,
This mock might be called a few times in a row so,
Need to clone the responseJson and add id at the very last minute
*/
getResponse() {
Expand Down
2 changes: 1 addition & 1 deletion addon/mocks/mock-get-request.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class MockGetRequest extends MockRequest {
}

/**
Used for inspecting the repsonse that this mock will generate
Used for inspecting the response that this mock will generate

Usually the args will be an attribute like 'id', but it might
also be a number like 0 or 1 for and index to list types.
Expand Down
6 changes: 3 additions & 3 deletions addon/model-definition.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class ModelDefinition {
let traitsObj = {};
traitArgs.forEach((trait)=> {
if (!this.traits[trait]) {
Ember.warn(`[ember-data-factory-guy] Your trying to use a trait [${trait}] for model ${this.modelName} but that trait can not be found.`, null, { id: 'ember-data-factory-guy-trait-does-not-exist' });
Ember.warn(`[ember-data-factory-guy] You're trying to use a trait [${trait}] for model ${this.modelName} but that trait can not be found.`, null, { id: 'ember-data-factory-guy-trait-does-not-exist' });
}
$.extend(traitsObj, this.traits[trait]);
});
Expand All @@ -167,7 +167,7 @@ class ModelDefinition {
if (attributeType === 'function') {
this.addFunctionAttribute(fixture, attribute);
} else if (attributeType === 'object') {
this.addObjectAtribute(fixture, attribute);
this.addObjectAttribute(fixture, attribute);
}
}
} catch (e) {
Expand All @@ -189,7 +189,7 @@ class ModelDefinition {
fixture[attribute] = fixture[attribute].call(this, fixture);
}

addObjectAtribute(fixture, attribute) {
addObjectAttribute(fixture, attribute) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only change I'm worried about - is there any possible callers of this function apart from earlier in this file (L170)?

// If it's an object and it's a model association attribute, build the json
// for the association and replace the attribute with that json
let relationship = this.getRelationship(attribute);
Expand Down
2 changes: 1 addition & 1 deletion addon/utils/manual-setup.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// For manually setting up FactoryGuy in unit/integration tests where the applicaiton is not started
// For manually setting up FactoryGuy in unit/integration tests where the application is not started
import FactoryGuy from '../factory-guy';
import loadFactories from './load-factories';
import loadScenarios from './load-scenarios';
Expand Down
4 changes: 2 additions & 2 deletions tests/dummy/app/tests/factories/cat.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import FactoryGuy from 'ember-data-factory-guy';
FactoryGuy.define('cat', {
polymorphic: false,
default: {
// usually, an attribute named 'type' is for polymorphic models, but the defenition
// is set as NOT polymorphic, which allows this type to work as attibute
// usually, an attribute named 'type' is for polymorphic models, but the definition
// is set as NOT polymorphic, which allows this type to work as attribute
type: 'Cute',
name: (f)=> `Cat ${f.id}`,
friend: (f)=> `Friend ${f.id}`
Expand Down
2 changes: 1 addition & 1 deletion tests/helpers/utility-methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ function containerSetup(container, serializerType) {

store.serializerFor = function(modelName) {
// all the modelFragment types will use their own default serializer
// and manager is always REST serialiezr ( used in rest tests )
// and manager is always REST serializer ( used in rest tests )
let originalSerializer = findSerializer(modelName);
if (modelName.match(/(name|department|address|department-employment|manager)/)) {
return originalSerializer;
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/drf-adapter-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ SharedFactoryGuyTestHelperBehavior.mockUpdateReturnsEmbeddedAssociations(seriali
moduleFor('serializer:application', `${serializer} #mockDelete`, inlineSetup(serializerType));
SharedFactoryGuyTestHelperBehavior.mockDeleteTests();

moduleFor('serializer:application', `${serializer} DRFAdapeter | #mockQuery | meta`, inlineSetup(serializerType));
moduleFor('serializer:application', `${serializer} DRFAdapter | #mockQuery | meta`, inlineSetup(serializerType));
// drf serializer takes the previous and next and extracts the page number
// so this needed it's own test
test("with proxy payload", function(assert) {
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/factory-guy-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ test("has store set in initializer", function(assert) {
assert.ok(FactoryGuy.store instanceof DS.Store);
});

test('make throws excpetion if there is NO store setup', function(assert) {
test('make throws exception if there is NO store setup', function(assert) {
FactoryGuy.store = null;
assert.throws(
function() {
Expand All @@ -26,7 +26,7 @@ test('make throws excpetion if there is NO store setup', function(assert) {
});
});

test('makeList throws excpetion if there is NO store setup', function(assert) {
test('makeList throws exception if there is NO store setup', function(assert) {
FactoryGuy.store = null;
assert.throws(
function() {
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/models/profile-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ test('composing a profile with a company association by making both', function(a
assert.ok(profile.get('company.profile') === profile);
});

test('using this.subject for profile and make for company associaion', function(assert) {
test('using this.subject for profile and make for company association', function(assert) {
let profile = this.subject({company: make('company')});
assert.ok(profile.get('company.profile') === profile);
});
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/models/user-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { test, moduleForModel } from 'ember-qunit';

But you do need to user moduleForModel instead of just module

As long as your using ember 2.3 of have ember-getowner-pollyfill addon installed
As long as you're using ember 2.3 of have ember-getowner-pollyfill addon installed
this style should work for you, and be speedier than calling startApp()

If this does not work for you ( for whatever reason ) take a look at
Expand Down
10 changes: 5 additions & 5 deletions tests/unit/shared-factory-guy-test-helper-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ SharedBehavior.mockFindAllSideloadingTests = function(serializer, serializerType
// let json = buildList('profile', 'with_company');
// mockFindAll('profile').withParams({include: 'company'}).returns({ json });
//
// FactoryGuy.store.findAll('profile', {inlcude: 'company'}).then(function(profiles) {
// FactoryGuy.store.findAll('profile', {include: 'company'}).then(function(profiles) {
// ok(profiles.get('firstObject.company.name') === 'Silly corp');
// done();
// });
Expand Down Expand Up @@ -770,7 +770,7 @@ SharedBehavior.mockQueryTests = function() {
});
});

test("reusing mock query using returns with differnet models and different params returns different results", function(assert) {
test("reusing mock query using returns with different models and different params returns different results", function(assert) {
Ember.run(()=> {
let done = assert.async();

Expand Down Expand Up @@ -824,7 +824,7 @@ SharedBehavior.mockQueryTests = function() {
});
});

test("reusing mock query using returns with differnt models and withParams with different params returns different results", function(assert) {
test("reusing mock query using returns with different models and withParams with different params returns different results", function(assert) {
Ember.run(()=> {
let done = assert.async();

Expand Down Expand Up @@ -966,7 +966,7 @@ SharedBehavior.mockQueryRecordTests = function() {
});
});

test("twice using returns with differnet json and different params returns different results", function(assert) {
test("twice using returns with different json and different params returns different results", function(assert) {
Ember.run(()=> {
let done = assert.async();

Expand All @@ -987,7 +987,7 @@ SharedBehavior.mockQueryRecordTests = function() {
});
});

test("reusing mock using returns with differnt json and withParams with different params returns different results", function(assert) {
test("reusing mock using returns with different json and withParams with different params returns different results", function(assert) {
Ember.run(()=> {
let done = assert.async();

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/utils/helper-functions-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ test('#isEquivalent with objects', function(assert) {

test('#isEquivalent with deeply nested objects', function(assert) {
// we don't use nestedTomster or nestedZoey in the friends array to avoid
// infinite recurrsion
// infinite recursion

let nestedTomster = {
name: tomster.name,
Expand Down