diff --git a/app/assets/javascripts/discourse/components/composer-title.js.es6 b/app/assets/javascripts/discourse/components/composer-title.js.es6 index b664023aa18..91cdf7186c1 100644 --- a/app/assets/javascripts/discourse/components/composer-title.js.es6 +++ b/app/assets/javascripts/discourse/components/composer-title.js.es6 @@ -68,7 +68,8 @@ export default Ember.Component.extend({ if (loadOnebox && loadOnebox.then) { loadOnebox.then( () => { - this._updatePost(lookupCache(this.get('composer.title'))); + const v = lookupCache(this.get('composer.title')); + this._updatePost(v ? v : link); }).finally(() => { this.set('composer.loading', false); Ember.run.schedule('afterRender', () => { this.$('input').putCursorAtEnd(); }); diff --git a/test/javascripts/acceptance/composer-topic-links-test.js.es6 b/test/javascripts/acceptance/composer-topic-links-test.js.es6 index 00ead70521f..c6bede46ffe 100644 --- a/test/javascripts/acceptance/composer-topic-links-test.js.es6 +++ b/test/javascripts/acceptance/composer-topic-links-test.js.es6 @@ -35,8 +35,8 @@ test("no onebox result", () => { click('#create-topic'); fillIn('#reply-title', "http://www.example.com/nope-onebox.html"); andThen(() => { - equal(find('.d-editor-preview').html().trim().indexOf('onebox'), -1, "link isn't put into the post"); - equal(find('.d-editor-input').val().length, 0, "link isn't put into the post"); + ok(find('.d-editor-preview').html().trim().indexOf('onebox') > 0, "it pastes the link into the body and previews it"); + ok(exists('.d-editor-textarea-wrapper .popup-tip.good'), 'link is pasted into body'); equal(find('.title-input input').val(), "http://www.example.com/nope-onebox.html", "title is unchanged"); }); });