about summary refs log tree commit diff
path: root/spec
diff options
context:
space:
mode:
authorJenkins <jenkins@jenkins.ninjawedding.org>2018-02-11 23:17:11 +0000
committerJenkins <jenkins@jenkins.ninjawedding.org>2018-02-11 23:17:11 +0000
commite9052ceaafff786590fb66bee4550878cfb5a0df (patch)
treefa95aed6a9c35752bf4e6f729fae902bda44e50f /spec
parent5ffa6f0fa12f5711e96b861c9813f3ec53bac3ee (diff)
parent6ef3874b2eac79cc2b602de609793254b8d6c611 (diff)
Merge remote-tracking branch 'tootsuite/master' into glitchsoc/master
Diffstat (limited to 'spec')
-rw-r--r--spec/services/fetch_link_card_service_spec.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/services/fetch_link_card_service_spec.rb b/spec/services/fetch_link_card_service_spec.rb
index ba61d22c3..edacc4425 100644
--- a/spec/services/fetch_link_card_service_spec.rb
+++ b/spec/services/fetch_link_card_service_spec.rb
@@ -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