mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-27 22:49:56 -05:00
parent
75caeb9341
commit
161afbf3c4
2 changed files with 6 additions and 6 deletions
|
@ -90,8 +90,8 @@ GhostMailer.prototype.fromAddress = function () {
|
||||||
domain = config().url.match(new RegExp("^https?://([^/:?#]+)(?:[/:?#]|$)", "i"));
|
domain = config().url.match(new RegExp("^https?://([^/:?#]+)(?:[/:?#]|$)", "i"));
|
||||||
domain = domain && domain[1];
|
domain = domain && domain[1];
|
||||||
|
|
||||||
// Default to webmaster@[blog.url]
|
// Default to ghost@[blog.url]
|
||||||
from = 'webmaster@' + domain;
|
from = 'ghost@' + domain;
|
||||||
}
|
}
|
||||||
|
|
||||||
return from;
|
return from;
|
||||||
|
|
|
@ -174,18 +174,18 @@ describe("Mail", function () {
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should fall back to webmaster@[blog.url] as from address', function (done) {
|
it('should fall back to ghost@[blog.url] as from address', function (done) {
|
||||||
// Standard domain
|
// Standard domain
|
||||||
overrideConfig({url: 'http://default.com', mail:{fromaddress: null}});
|
overrideConfig({url: 'http://default.com', mail:{fromaddress: null}});
|
||||||
mailer.fromAddress().should.equal('webmaster@default.com');
|
mailer.fromAddress().should.equal('ghost@default.com');
|
||||||
|
|
||||||
// Trailing slash
|
// Trailing slash
|
||||||
overrideConfig({url: 'http://default.com/', mail:{}});
|
overrideConfig({url: 'http://default.com/', mail:{}});
|
||||||
mailer.fromAddress().should.equal('webmaster@default.com');
|
mailer.fromAddress().should.equal('ghost@default.com');
|
||||||
|
|
||||||
// Strip Port
|
// Strip Port
|
||||||
overrideConfig({url: 'http://default.com:2368/', mail:{}});
|
overrideConfig({url: 'http://default.com:2368/', mail:{}});
|
||||||
mailer.fromAddress().should.equal('webmaster@default.com');
|
mailer.fromAddress().should.equal('ghost@default.com');
|
||||||
|
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue