diff --git a/Changelog.md b/Changelog.md index 7255415d9..baa6415c5 100644 --- a/Changelog.md +++ b/Changelog.md @@ -11,6 +11,7 @@ * Don't error out in script/server if git is unavailable. * Fix post preview from tag pages [#4157](https://github.com/diaspora/diaspora/issues/4157) * Fix tags ordering in chrome [#4133](https://github.com/diaspora/diaspora/issues/4133) +* Fix src URL for oEmbed iFrame [#4178](https://github.com/diaspora/diaspora/pull/4178) ## Features diff --git a/app/helpers/posts_helper.rb b/app/helpers/posts_helper.rb index efd741df3..5d073a853 100644 --- a/app/helpers/posts_helper.rb +++ b/app/helpers/posts_helper.rb @@ -20,7 +20,7 @@ module PostsHelper def post_iframe_url(post_id, opts={}) opts[:width] ||= 516 opts[:height] ||= 315 - host = AppConfig.pod_uri.site + host = AppConfig.pod_uri.authority "".html_safe end end diff --git a/spec/helpers/posts_helper_spec.rb b/spec/helpers/posts_helper_spec.rb new file mode 100644 index 000000000..eb5d5bcd2 --- /dev/null +++ b/spec/helpers/posts_helper_spec.rb @@ -0,0 +1,21 @@ +# Copyright (c) 2010-2011, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3 or later. See +# the COPYRIGHT file. + +require 'spec_helper' + +describe PostsHelper do + describe '#post_iframe_url' do + before do + @post = FactoryGirl.create(:status_message) + end + + it "returns an iframe tag" do + post_iframe_url(@post.id).should include "iframe" + end + + it "returns an iframe containing the post" do + post_iframe_url(@post.id).should include "src='http://localhost:9887#{post_path(@post)}'" + end + end +end