FIX: S3Cdn link clicks weren't working

This commit is contained in:
Robin Ward
2016-06-28 15:52:38 -04:00
parent 76766a25bf
commit 61ce5c210c
2 changed files with 36 additions and 5 deletions

View File

@@ -144,6 +144,24 @@ describe TopicLinkClick do
end
context "s3 cdns" do
it "works with s3 urls" do
SiteSetting.s3_cdn_url = "https://discourse-s3-cdn.global.ssl.fastly.net"
post = Fabricate(:post, topic: @topic, raw: "[test](//test.localhost/uploads/default/my-test-link)")
TopicLink.extract_from(post)
url = TopicLinkClick.create_from(
url: "https://discourse-s3-cdn.global.ssl.fastly.net/my-test-link",
topic_id: @topic.id,
ip: '127.0.0.3')
expect(url).to be_present
end
end
end
context 'with a HTTPS version of the same URL' do