Merge remote-tracking branch 'tootsuite/master' into glitchsoc/master

This commit is contained in:
Jenkins
2018-02-11 23:17:11 +00:00
3 changed files with 13 additions and 2 deletions

View File

@@ -15,6 +15,8 @@ RSpec.describe FetchLinkCardService do
stub_request(:head, 'http://example.com/日本語').to_return(status: 200, headers: { 'Content-Type' => 'text/html' })
stub_request(:get, 'http://example.com/日本語').to_return(request_fixture('sjis.txt'))
stub_request(:head, 'https://github.com/qbi/WannaCry').to_return(status: 404)
stub_request(:head, 'http://example.com/test-').to_return(status: 200, headers: { 'Content-Type' => 'text/html' })
stub_request(:get, 'http://example.com/test-').to_return(request_fixture('idn.txt'))
subject.call(status)
end
@@ -63,6 +65,14 @@ RSpec.describe FetchLinkCardService do
expect(status.preview_cards.first.title).to eq("SJISのページ")
end
end
context do
let(:status) { Fabricate(:status, text: 'test http://example.com/test-') }
it 'works with a URL ending with a hyphen' do
expect(a_request(:get, 'http://example.com/test-')).to have_been_made.at_least_once
end
end
end
context 'in a remote status' do