mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-22 10:21:36 +03:00
7c2e923074
refs https://github.com/TryGhost/Ghost/pull/6941#issuecomment-224553575 - `blogTimezone` and `timezone` better reflect their values (a string representing a timezone in the format `Europe/Dublin`) than `offset` which suggests a fixed value
53 lines
1.1 KiB
JavaScript
53 lines
1.1 KiB
JavaScript
import { expect } from 'chai';
|
|
import {
|
|
describeModule,
|
|
it
|
|
} from 'ember-mocha';
|
|
import Pretender from 'pretender';
|
|
import Ember from 'ember';
|
|
|
|
function settingsStub(server) {
|
|
let settings = [
|
|
{
|
|
id: '1',
|
|
type: 'blog',
|
|
key: 'activeTimezone',
|
|
value: 'Africa/Cairo'
|
|
}
|
|
];
|
|
|
|
server.get('/ghost/api/v0.1/settings/', function () {
|
|
return [200, {'Content-Type': 'application/json'}, JSON.stringify({settings})];
|
|
});
|
|
}
|
|
|
|
describeModule(
|
|
'service:time-zone',
|
|
'Integration: Service: time-zone',
|
|
{
|
|
integration: true
|
|
},
|
|
function () {
|
|
let server;
|
|
|
|
beforeEach(function () {
|
|
server = new Pretender();
|
|
});
|
|
|
|
afterEach(function () {
|
|
server.shutdown();
|
|
});
|
|
|
|
it('should return the blogs timezone', function (done) {
|
|
let service = this.subject();
|
|
|
|
settingsStub(server);
|
|
|
|
service.get('blogTimezone').then(function (blogTimezone) {
|
|
expect(blogTimezone).to.equal('Africa/Cairo');
|
|
done();
|
|
});
|
|
});
|
|
}
|
|
);
|