mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-18 02:21:47 -05:00
Changed the lingo to US of A variation
refs 16728a3ef1
- It's 'merica time!
This commit is contained in:
parent
03c5201d51
commit
e9bfc4ef01
26 changed files with 49 additions and 49 deletions
|
@ -1,7 +1,7 @@
|
|||
// # Title Helper
|
||||
// Usage: `{{title}}`
|
||||
//
|
||||
// Overrides the standard behaviour of `{[title}}` to ensure the content is correctly escaped
|
||||
// Overrides the standard beharior of `{[title}}` to ensure the content is correctly escaped
|
||||
|
||||
const {SafeString, escapeExpression} = require('../services/handlebars');
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ const commentMapper = (model, frame) => {
|
|||
}
|
||||
|
||||
if (jsonModel.post) {
|
||||
// We could use the post mapper here, but we need less field + don't need al the async behaviour support
|
||||
// We could use the post mapper here, but we need less field + don't need al the async beharior support
|
||||
url.forPost(jsonModel.post.id, jsonModel.post, frame);
|
||||
response.post = _.pick(jsonModel.post, postFields);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// # Base Model
|
||||
// This is the model from which all other Ghost models extend. The model is based on Bookshelf.Model, and provides
|
||||
// several basic behaviours such as UUIDs, as well as a set of Data methods for accessing information from the database.
|
||||
// several basic behariors such as UUIDs, as well as a set of Data methods for accessing information from the database.
|
||||
//
|
||||
// The models are internal to Ghost, only the API and some internal functions such as migration and import/export
|
||||
// accesses the models directly.
|
||||
|
|
|
@ -6,13 +6,13 @@ module.exports = function (Bookshelf) {
|
|||
getFilteredCollection: function getFilteredCollection(options) {
|
||||
const filteredCollection = this.forge();
|
||||
|
||||
// Apply model-specific query behaviour
|
||||
// Apply model-specific query beharior
|
||||
filteredCollection.applyCustomQuery(options);
|
||||
|
||||
// Add Filter behaviour
|
||||
// Add Filter beharior
|
||||
filteredCollection.applyDefaultAndCustomFilters(options);
|
||||
|
||||
// Apply model-specific search behaviour
|
||||
// Apply model-specific search beharior
|
||||
filteredCollection.applySearchQuery(options);
|
||||
|
||||
return filteredCollection;
|
||||
|
|
|
@ -103,7 +103,7 @@ Tag = ghostBookshelf.Model.extend({
|
|||
// Support tag creation with `posts: [{..., tags: [{slug: 'new'}]}]`
|
||||
// In that situation we have a slug but no name so validation will fail
|
||||
// unless we set one automatically. Re-using slug for name matches our
|
||||
// opposite name->slug behaviour.
|
||||
// opposite name->slug beharior.
|
||||
if (!newTag.get('name') && newTag.get('slug')) {
|
||||
this.set('name', newTag.get('slug'));
|
||||
}
|
||||
|
|
|
@ -234,7 +234,7 @@ User = ghostBookshelf.Model.extend({
|
|||
* - we do some pre-validation checks, because onValidate is called AFTER onSaving
|
||||
* - when importing, we set the password to a random uid and don't validate, just hash it and lock the user
|
||||
* - when importing with `importPersistUser` we check if the password is a bcrypt hash already and fall back to
|
||||
* normal behaviour if not (set random password, lock user, and hash password)
|
||||
* normal beharior if not (set random password, lock user, and hash password)
|
||||
* - no validations should run, when importing
|
||||
*/
|
||||
if (self.hasChanged('password')) {
|
||||
|
@ -242,7 +242,7 @@ User = ghostBookshelf.Model.extend({
|
|||
|
||||
// CASE: import with `importPersistUser` should always be an bcrypt password already,
|
||||
// and won't re-hash or overwrite it.
|
||||
// In case the password is not bcrypt hashed we fall back to the standard behaviour.
|
||||
// In case the password is not bcrypt hashed we fall back to the standard beharior.
|
||||
if (options.importPersistUser && this.get('password').match(/^\$2[ayb]\$.{56}$/i)) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -104,7 +104,7 @@ const sendTestEmail = async (postModel, toEmails, memberSegment) => {
|
|||
};
|
||||
}));
|
||||
|
||||
// enable tracking for previews to match real-world behaviour
|
||||
// enable tracking for previews to match real-world beharior
|
||||
emailData.track_opens = !!settingsCache.get('email_track_opens');
|
||||
|
||||
const response = await bulkEmailService.send(emailData, recipients, memberSegment);
|
||||
|
|
|
@ -159,7 +159,7 @@ class Resources {
|
|||
* @description Call the model layer to fetch a single resource via raw knex queries.
|
||||
*
|
||||
* This function was invented, because the model event is a generic event, which is independent of any
|
||||
* api version behaviour. We have to ensure that a model matches the conditions of the configured api version
|
||||
* api version beharior. We have to ensure that a model matches the conditions of the configured api version
|
||||
* in the theme.
|
||||
*
|
||||
* See https://github.com/TryGhost/Ghost/issues/10124.
|
||||
|
|
|
@ -56,7 +56,7 @@ class CacheManager {
|
|||
return this.settingsCache[key];
|
||||
}
|
||||
|
||||
// Default behaviour is to try to resolve the value and return that
|
||||
// Default behavior is to try to resolve the value and return that
|
||||
try {
|
||||
// CASE: handle literal false
|
||||
if (this.settingsCache[key].value === false || this.settingsCache[key].value === 'false') {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// # Default Frontend Routing Test
|
||||
// These tests check the default out-of-the-box behaviour of Ghost is working as expected.
|
||||
// These tests check the default out-of-the-box beharior of Ghost is working as expected.
|
||||
|
||||
// Test Structure
|
||||
// As it stands, these tests depend on the database, and as such are integration tests.
|
||||
|
|
|
@ -20,7 +20,7 @@ function assertContentIsAbsent(res) {
|
|||
res.text.should.not.containEql('<h2 id="markdown">markdown</h2>');
|
||||
}
|
||||
|
||||
describe('Front-end members behaviour', function () {
|
||||
describe('Front-end members beharior', function () {
|
||||
let request;
|
||||
|
||||
async function loginAsMember(email) {
|
||||
|
|
|
@ -426,7 +426,7 @@ describe('Posts API', function () {
|
|||
res.body.posts[0].tags.length.should.equal(1);
|
||||
res.body.posts[0].tags[0].slug.should.equal('five-spaces');
|
||||
|
||||
// Expected behaviour when creating a slug with spaces:
|
||||
// Expected beharior when creating a slug with spaces:
|
||||
res.body.posts[0].tags[0].name.should.equal('five-spaces');
|
||||
|
||||
// If we create another post again now that the five-spaces tag exists,
|
||||
|
|
|
@ -10,7 +10,7 @@ const urlUtils = require('../../utils/urlUtils');
|
|||
const routeSettingsService = require('../../../core/server/services/route-settings');
|
||||
const themeEngine = require('../../../core/frontend/services/theme-engine');
|
||||
|
||||
describe('Frontend behaviour tests', function () {
|
||||
describe('Frontend beharior tests', function () {
|
||||
let app;
|
||||
|
||||
before(localUtils.urlService.resetGenerators);
|
||||
|
@ -49,7 +49,7 @@ describe('Frontend behaviour tests', function () {
|
|||
sinon.restore();
|
||||
});
|
||||
|
||||
describe('behaviour: default cases', function () {
|
||||
describe('beharior: default cases', function () {
|
||||
it('serve post', function () {
|
||||
const req = {
|
||||
method: 'GET',
|
||||
|
@ -232,7 +232,7 @@ describe('Frontend behaviour tests', function () {
|
|||
});
|
||||
});
|
||||
|
||||
describe('behaviour: prettify', function () {
|
||||
describe('beharior: prettify', function () {
|
||||
it('url without slash', function () {
|
||||
const req = {
|
||||
secure: false,
|
||||
|
@ -249,7 +249,7 @@ describe('Frontend behaviour tests', function () {
|
|||
});
|
||||
});
|
||||
|
||||
describe('behaviour: url redirects', function () {
|
||||
describe('beharior: url redirects', function () {
|
||||
describe('pagination', function () {
|
||||
it('redirect /page/1/ to /', function () {
|
||||
const req = {
|
||||
|
|
|
@ -19,7 +19,7 @@ const markdownToMobiledoc = testUtils.DataGenerator.markdownToMobiledoc;
|
|||
/**
|
||||
* IMPORTANT:
|
||||
* - do not spy the events unit, because when we only spy, all listeners get the event
|
||||
* - this can cause unexpected behaviour as the listeners execute code
|
||||
* - this can cause unexpected beharior as the listeners execute code
|
||||
* - using rewire is not possible, because each model self registers it's model registry in bookshelf
|
||||
* - rewire would add 1 registry, a file who requires the models, tries to register the model another time
|
||||
*/
|
||||
|
|
|
@ -100,7 +100,7 @@ describe('Private Blogging', function () {
|
|||
req.session = {};
|
||||
});
|
||||
|
||||
describe('Logged Out Behaviour', function () {
|
||||
describe('Logged Out beharior', function () {
|
||||
it('authenticatePrivateSession should redirect', function () {
|
||||
req.path = req.url = '/welcome/';
|
||||
privateBlogging.authenticatePrivateSession(req, res, next);
|
||||
|
@ -182,7 +182,7 @@ describe('Private Blogging', function () {
|
|||
});
|
||||
|
||||
it('should render custom robots.txt', function () {
|
||||
// Note this test doesn't cover the full site behaviour,
|
||||
// Note this test doesn't cover the full site beharior,
|
||||
// another robots.txt can be incorrectly served if middleware is out of order
|
||||
req.url = req.path = '/robots.txt';
|
||||
res.writeHead = sinon.spy();
|
||||
|
@ -315,7 +315,7 @@ describe('Private Blogging', function () {
|
|||
});
|
||||
});
|
||||
|
||||
describe('Logged In Behaviour', function () {
|
||||
describe('Logged In beharior', function () {
|
||||
beforeEach(function () {
|
||||
const salt = Date.now().toString();
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ describe('{{link}} helper', function () {
|
|||
configUtils.restore();
|
||||
});
|
||||
|
||||
describe('basic behaviour: simple links without context', function () {
|
||||
describe('basic beharior: simple links without context', function () {
|
||||
it('throws an error for missing href=""', function () {
|
||||
(function compileWith() {
|
||||
compile('{{#link}}text{{/link}}')
|
||||
|
@ -121,7 +121,7 @@ describe('{{link}} helper', function () {
|
|||
});
|
||||
});
|
||||
|
||||
describe('dynamic behaviour: advanced links using context', function () {
|
||||
describe('dynamic beharior: advanced links using context', function () {
|
||||
describe('activeClass', function () {
|
||||
it('gets applied correctly', function () {
|
||||
// Test matching relative URL
|
||||
|
|
|
@ -260,7 +260,7 @@ describe('Match helper', function () {
|
|||
// allows us to know if the original value was a boolean or a string
|
||||
// These tests make sure that we can compare to the _originaL_ value
|
||||
// But that we don't start allowing weird things like boolean true being equal to string true
|
||||
describe('SafeString behaviour makes sense(ish)', function () {
|
||||
describe('SafeString beharior makes sense(ish)', function () {
|
||||
runTests({
|
||||
// Title equals true value = true
|
||||
'{{match (match title "=" "The Title") "=" "true"}}': 'false',
|
||||
|
|
|
@ -8,7 +8,7 @@ const logging = {
|
|||
error: sinon.stub()
|
||||
};
|
||||
|
||||
describe('I18n Class Behaviour', function () {
|
||||
describe('I18n Class beharior', function () {
|
||||
it('defaults to en', function () {
|
||||
const i18n = new I18n({logging});
|
||||
i18n.locale().should.eql('en');
|
||||
|
@ -19,7 +19,7 @@ describe('I18n Class Behaviour', function () {
|
|||
i18n.locale().should.eql('fr');
|
||||
});
|
||||
|
||||
describe('file loading behaviour', function () {
|
||||
describe('file loading beharior', function () {
|
||||
it('will fallback to en file correctly without changing locale', function () {
|
||||
const i18n = new I18n({locale: 'fr', logging});
|
||||
|
||||
|
@ -34,7 +34,7 @@ describe('I18n Class Behaviour', function () {
|
|||
});
|
||||
});
|
||||
|
||||
describe('translation key dot notation (default behaviour)', function () {
|
||||
describe('translation key dot notation (default beharior)', function () {
|
||||
const fakeStrings = {
|
||||
test: {string: {path: 'I am correct'}}
|
||||
};
|
||||
|
@ -65,7 +65,7 @@ describe('I18n Class Behaviour', function () {
|
|||
});
|
||||
});
|
||||
|
||||
describe('translation key fulltext notation (theme behaviour)', function () {
|
||||
describe('translation key fulltext notation (theme beharior)', function () {
|
||||
const fakeStrings = {'Full text': 'I am correct'};
|
||||
let i18n;
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ const should = require('should');
|
|||
|
||||
const ThemeI18n = require('../../../../../core/frontend/services/theme-engine/i18n').ThemeI18n;
|
||||
|
||||
describe('ThemeI18n Class Behaviour', function () {
|
||||
describe('ThemeI18n Class beharior', function () {
|
||||
it('defaults to en', function () {
|
||||
const i18n = new ThemeI18n();
|
||||
i18n.locale().should.eql('en');
|
||||
|
|
|
@ -240,7 +240,7 @@ describe('Importer', function () {
|
|||
it('accepts a zip with a base directory', async function () {
|
||||
const testDir = path.resolve('test/utils/fixtures/import/zips/zip-with-base-dir');
|
||||
const extractSpy = sinon.stub(ImportManager, 'extractZip').returns(Promise.resolve(testDir));
|
||||
|
||||
|
||||
const zipResult = await ImportManager.processZip(testZip);
|
||||
zipResult.data.should.not.be.undefined();
|
||||
should(zipResult.images).be.undefined();
|
||||
|
@ -270,7 +270,7 @@ describe('Importer', function () {
|
|||
it('accepts a zip with uppercase image extensions', async function () {
|
||||
const testDir = path.resolve('test/utils/fixtures/import/zips/zip-uppercase-extensions');
|
||||
const extractSpy = sinon.stub(ImportManager, 'extractZip').returns(Promise.resolve(testDir));
|
||||
|
||||
|
||||
const zipResult = await ImportManager.processZip(testZip);
|
||||
zipResult.images.length.should.eql(1);
|
||||
should(zipResult.data).be.undefined();
|
||||
|
@ -280,7 +280,7 @@ describe('Importer', function () {
|
|||
it('throws zipContainsMultipleDataFormats', async function () {
|
||||
const testDir = path.resolve('test/utils/fixtures/import/zips/zip-multiple-data-formats');
|
||||
const extractSpy = sinon.stub(ImportManager, 'extractZip').returns(Promise.resolve(testDir));
|
||||
|
||||
|
||||
await should(ImportManager.processZip(testZip)).rejectedWith(/multiple data formats/);
|
||||
extractSpy.calledOnce.should.be.true();
|
||||
});
|
||||
|
@ -288,7 +288,7 @@ describe('Importer', function () {
|
|||
it('throws noContentToImport', async function () {
|
||||
const testDir = path.resolve('test/utils/fixtures/import/zips/zip-empty');
|
||||
const extractSpy = sinon.stub(ImportManager, 'extractZip').returns(Promise.resolve(testDir));
|
||||
|
||||
|
||||
await should(ImportManager.processZip(testZip)).rejectedWith(/not include any content/);
|
||||
extractSpy.calledOnce.should.be.true();
|
||||
});
|
||||
|
@ -326,7 +326,7 @@ describe('Importer', function () {
|
|||
});
|
||||
});
|
||||
|
||||
describe('Zip behaviour', function () {
|
||||
describe('Zip beharior', function () {
|
||||
it('can call extract and error correctly', function () {
|
||||
return ImportManager
|
||||
// Deliberately pass something that can't be extracted just to check this method signature is working
|
||||
|
|
|
@ -172,7 +172,7 @@ describe('External Request', function () {
|
|||
});
|
||||
});
|
||||
|
||||
describe('general behaviour', function () {
|
||||
describe('general beharior', function () {
|
||||
beforeEach(function () {
|
||||
sinon.stub(dnsPromises, 'lookup').callsFake(function (host) {
|
||||
return Promise.resolve({address: '123.123.123.123'});
|
||||
|
|
|
@ -58,7 +58,7 @@ describe('Members Service Middleware', function () {
|
|||
// Call the middleware
|
||||
await membersMiddleware.createSessionFromMagicLink(req, res, next);
|
||||
|
||||
// Check behaviour
|
||||
// Check beharior
|
||||
next.calledOnce.should.be.true();
|
||||
next.firstCall.args.should.be.an.Array().with.lengthOf(0);
|
||||
});
|
||||
|
@ -80,7 +80,7 @@ describe('Members Service Middleware', function () {
|
|||
// Call the middleware
|
||||
await membersMiddleware.createSessionFromMagicLink(req, res, next);
|
||||
|
||||
// Check behaviour
|
||||
// Check beharior
|
||||
next.calledOnce.should.be.false();
|
||||
res.redirect.calledOnce.should.be.true();
|
||||
res.redirect.firstCall.args[0].should.eql('/blah/?action=signup&success=true');
|
||||
|
@ -96,7 +96,7 @@ describe('Members Service Middleware', function () {
|
|||
// Call the middleware
|
||||
await membersMiddleware.createSessionFromMagicLink(req, res, next);
|
||||
|
||||
// Check behaviour
|
||||
// Check beharior
|
||||
next.calledOnce.should.be.false();
|
||||
res.redirect.calledOnce.should.be.true();
|
||||
res.redirect.firstCall.args[0].should.eql('/blah/?action=signup&success=false');
|
||||
|
@ -119,7 +119,7 @@ describe('Members Service Middleware', function () {
|
|||
// Call the middleware
|
||||
await membersMiddleware.createSessionFromMagicLink(req, res, next);
|
||||
|
||||
// Check behaviour
|
||||
// Check beharior
|
||||
next.calledOnce.should.be.false();
|
||||
res.redirect.calledOnce.should.be.true();
|
||||
res.redirect.firstCall.args[0].should.eql('https://custom.com/redirect/');
|
||||
|
@ -142,7 +142,7 @@ describe('Members Service Middleware', function () {
|
|||
// Call the middleware
|
||||
await membersMiddleware.createSessionFromMagicLink(req, res, next);
|
||||
|
||||
// Check behaviour
|
||||
// Check beharior
|
||||
next.calledOnce.should.be.false();
|
||||
res.redirect.calledOnce.should.be.true();
|
||||
res.redirect.firstCall.args[0].should.eql('https://custom.com/paid/');
|
||||
|
@ -158,7 +158,7 @@ describe('Members Service Middleware', function () {
|
|||
// Call the middleware
|
||||
await membersMiddleware.createSessionFromMagicLink(req, res, next);
|
||||
|
||||
// Check behaviour
|
||||
// Check beharior
|
||||
next.calledOnce.should.be.false();
|
||||
res.redirect.calledOnce.should.be.true();
|
||||
res.redirect.firstCall.args[0].should.eql('/blah/my-post/?success=true&action=signin');
|
||||
|
@ -174,7 +174,7 @@ describe('Members Service Middleware', function () {
|
|||
// Call the middleware
|
||||
await membersMiddleware.createSessionFromMagicLink(req, res, next);
|
||||
|
||||
// Check behaviour
|
||||
// Check beharior
|
||||
next.calledOnce.should.be.false();
|
||||
res.redirect.calledOnce.should.be.true();
|
||||
res.redirect.firstCall.args[0].should.eql('/blah/?action=signin&success=true');
|
||||
|
|
|
@ -195,7 +195,7 @@ const truncateAll = () => {
|
|||
|
||||
/**
|
||||
* @deprecated Use teardown or reset instead
|
||||
* Old method for clearing data from the database that also mixes in url service behaviour
|
||||
* Old method for clearing data from the database that also mixes in url service beharior
|
||||
*/
|
||||
module.exports.clearData = async () => {
|
||||
debug('Database reset');
|
||||
|
@ -205,7 +205,7 @@ module.exports.clearData = async () => {
|
|||
|
||||
/**
|
||||
* @deprecated Use reset instead
|
||||
* Old method for clearing data from the database that also mixes in url service behaviour
|
||||
* Old method for clearing data from the database that also mixes in url service beharior
|
||||
*/
|
||||
module.exports.initData = async () => {
|
||||
await knexMigrator.init();
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "members-test-theme",
|
||||
"description": "A minimal theme for testing members behaviour",
|
||||
"description": "A minimal theme for testing members beharior",
|
||||
"version": "1.0.0",
|
||||
"license": "MIT",
|
||||
"config": {
|
||||
|
|
|
@ -2,7 +2,7 @@ module.exports = class EventProcessor {
|
|||
constructor() {
|
||||
}
|
||||
|
||||
// override these in a sub-class to define app-specific behaviour
|
||||
// override these in a sub-class to define app-specific beharior
|
||||
|
||||
async getEmailId(/*event*/) {
|
||||
return undefined;
|
||||
|
|
|
@ -9,7 +9,7 @@ describe('Html to Plaintext', function () {
|
|||
return {email, excerpt};
|
||||
}
|
||||
|
||||
describe('excerpt vs email behaviour', function () {
|
||||
describe('excerpt vs email beharior', function () {
|
||||
it('example case with img & link', function () {
|
||||
const input = '<p>Some thing <a href="https://google.com">Google</a> once told me.</p><img src="https://hotlink.com" alt="An important image"><p>And <strong>another</strong> thing.</p>';
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue