test-prof / test-prof-mastodon-ai-playground

TestProf AI vs. Mastodon demo
GNU Affero General Public License v3.0
0 stars 0 forks source link

[TestProf] Optimize: spec/services/fetch_link_card_service_spec.rb #2

Open github-actions[bot] opened 2 months ago

github-actions[bot] commented 2 months ago

Closes #1

github-actions[bot] commented 2 months ago

🤖 Thought: The file seems to be using a lot of let statements which can be slow. I'll try to optimize it by using let_it_be for objects that don't change between tests, and moving some of the setup into a before_all block.

Here are the results of running an updated version:

[TEST PROF INFO] FactoryProf enabled (simple mode)
[TEST PROF INFO] RSpecDissect enabled

Run options: exclude {:streaming=>true, :search=>true, :js=>true}

Randomized with seed 13172

Progress: |=

  1) FetchLinkCardService with a local status with a URL of a page in Shift JIS encoding decodes the HTML
     Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

     WebMock::NetConnectNotAllowedError:
       Real HTTP connections are disabled. Unregistered request: GET http://example.com/sjis with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:39:44 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

       You can stub this request with the following snippet:

       stub_request(:get, "http://example.com/sjis").
         with(
           headers: {
          'Accept'=>'text/html',
          'Accept-Encoding'=>'gzip',
          'Connection'=>'close',
          'Date'=>'Mon, 19 Aug 2024 12:39:44 GMT',
          'Host'=>'example.com',
          'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
           }).
         to_return(status: 200, body: "", headers: {})

       ============================================================
     # ./app/lib/request.rb:108:in `perform'
     # ./app/services/fetch_link_card_service.rb:48:in `html'
     # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
     # ./app/services/fetch_link_card_service.rb:42:in `process_url'
     # ./app/services/fetch_link_card_service.rb:28:in `block in call'
     # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
     # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
     # ./app/lib/redis_configuration.rb:10:in `with'
     # ./app/models/concerns/redisable.rb:9:in `with_redis'
     # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
     # ./app/services/fetch_link_card_service.rb:26:in `call'
     # ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:40:in `block (2 levels) in <top (required)>'
     # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |===

  2) FetchLinkCardService with a local status with a redirect URL creates preview card
     Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

     WebMock::NetConnectNotAllowedError:
       Real HTTP connections are disabled. Unregistered request: GET http://example.com/redirect with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:39:45 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

       You can stub this request with the following snippet:

       stub_request(:get, "http://example.com/redirect").
         with(
           headers: {
          'Accept'=>'text/html',
          'Accept-Encoding'=>'gzip',
          'Connection'=>'close',
          'Date'=>'Mon, 19 Aug 2024 12:39:45 GMT',
          'Host'=>'example.com',
          'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
           }).
         to_return(status: 200, body: "", headers: {})

       ============================================================
     # ./app/lib/request.rb:108:in `perform'
     # ./app/services/fetch_link_card_service.rb:48:in `html'
     # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
     # ./app/services/fetch_link_card_service.rb:42:in `process_url'
     # ./app/services/fetch_link_card_service.rb:28:in `block in call'
     # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
     # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
     # ./app/lib/redis_configuration.rb:10:in `with'
     # ./app/models/concerns/redisable.rb:9:in `with_redis'
     # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
     # ./app/services/fetch_link_card_service.rb:26:in `call'
     # ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:40:in `block (2 levels) in <top (required)>'
     # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |=====

  3) FetchLinkCardService with a local status with a redirect URL follows redirect
     Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

     WebMock::NetConnectNotAllowedError:
       Real HTTP connections are disabled. Unregistered request: GET http://example.com/redirect with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:39:45 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

       You can stub this request with the following snippet:

       stub_request(:get, "http://example.com/redirect").
         with(
           headers: {
          'Accept'=>'text/html',
          'Accept-Encoding'=>'gzip',
          'Connection'=>'close',
          'Date'=>'Mon, 19 Aug 2024 12:39:45 GMT',
          'Host'=>'example.com',
          'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
           }).
         to_return(status: 200, body: "", headers: {})

       ============================================================
     # ./app/lib/request.rb:108:in `perform'
     # ./app/services/fetch_link_card_service.rb:48:in `html'
     # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
     # ./app/services/fetch_link_card_service.rb:42:in `process_url'
     # ./app/services/fetch_link_card_service.rb:28:in `block in call'
     # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
     # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
     # ./app/lib/redis_configuration.rb:10:in `with'
     # ./app/models/concerns/redisable.rb:9:in `with_redis'
     # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
     # ./app/services/fetch_link_card_service.rb:26:in `call'
     # ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:40:in `block (2 levels) in <top (required)>'
     # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |=======

  4) FetchLinkCardService with a local status with a URL of a page in KOI8-R encoding decodes the HTML
     Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

     WebMock::NetConnectNotAllowedError:
       Real HTTP connections are disabled. Unregistered request: GET http://example.com/koi8-r with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:39:45 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

       You can stub this request with the following snippet:

       stub_request(:get, "http://example.com/koi8-r").
         with(
           headers: {
          'Accept'=>'text/html',
          'Accept-Encoding'=>'gzip',
          'Connection'=>'close',
          'Date'=>'Mon, 19 Aug 2024 12:39:45 GMT',
          'Host'=>'example.com',
          'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
           }).
         to_return(status: 200, body: "", headers: {})

       ============================================================
     # ./app/lib/request.rb:108:in `perform'
     # ./app/services/fetch_link_card_service.rb:48:in `html'
     # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
     # ./app/services/fetch_link_card_service.rb:42:in `process_url'
     # ./app/services/fetch_link_card_service.rb:28:in `block in call'
     # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
     # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
     # ./app/lib/redis_configuration.rb:10:in `with'
     # ./app/models/concerns/redisable.rb:9:in `with_redis'
     # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
     # ./app/services/fetch_link_card_service.rb:26:in `call'
     # ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:40:in `block (2 levels) in <top (required)>'
     # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |========

  5) FetchLinkCardService with a local status with a URL where the `Content-Type` header uses `utf8` instead of `utf-8` does not create a preview card
     Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

     WebMock::NetConnectNotAllowedError:
       Real HTTP connections are disabled. Unregistered request: GET http://example.com/alternative_utf8_spelling_in_header with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:39:45 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

       You can stub this request with the following snippet:

       stub_request(:get, "http://example.com/alternative_utf8_spelling_in_header").
         with(
           headers: {
          'Accept'=>'text/html',
          'Accept-Encoding'=>'gzip',
          'Connection'=>'close',
          'Date'=>'Mon, 19 Aug 2024 12:39:45 GMT',
          'Host'=>'example.com',
          'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
           }).
         to_return(status: 200, body: "", headers: {})

       ============================================================
     # ./app/lib/request.rb:108:in `perform'
     # ./app/services/fetch_link_card_service.rb:48:in `html'
     # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
     # ./app/services/fetch_link_card_service.rb:42:in `process_url'
     # ./app/services/fetch_link_card_service.rb:28:in `block in call'
     # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
     # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
     # ./app/lib/redis_configuration.rb:10:in `with'
     # ./app/models/concerns/redisable.rb:9:in `with_redis'
     # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
     # ./app/services/fetch_link_card_service.rb:26:in `call'
     # ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:40:in `block (2 levels) in <top (required)>'
     # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |==========

  6) FetchLinkCardService with a local status with an IDN URL fetches the URL
     Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

     WebMock::NetConnectNotAllowedError:
       Real HTTP connections are disabled. Unregistered request: GET http://example.xn--fiqs8s/ with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:39:45 GMT', 'Host'=>'example.xn--fiqs8s', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

       You can stub this request with the following snippet:

       stub_request(:get, "http://example.xn--fiqs8s/").
         with(
           headers: {
          'Accept'=>'text/html',
          'Accept-Encoding'=>'gzip',
          'Connection'=>'close',
          'Date'=>'Mon, 19 Aug 2024 12:39:45 GMT',
          'Host'=>'example.xn--fiqs8s',
          'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
           }).
         to_return(status: 200, body: "", headers: {})

       ============================================================
     # ./app/lib/request.rb:108:in `perform'
     # ./app/services/fetch_link_card_service.rb:48:in `html'
     # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
     # ./app/services/fetch_link_card_service.rb:42:in `process_url'
     # ./app/services/fetch_link_card_service.rb:28:in `block in call'
     # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
     # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
     # ./app/lib/redis_configuration.rb:10:in `with'
     # ./app/models/concerns/redisable.rb:9:in `with_redis'
     # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
     # ./app/services/fetch_link_card_service.rb:26:in `call'
     # ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:40:in `block (2 levels) in <top (required)>'
     # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |============

  7) FetchLinkCardService with a local status with a page that has no title does not create a preview card
     Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

     WebMock::NetConnectNotAllowedError:
       Real HTTP connections are disabled. Unregistered request: GET http://example.com/page_without_title with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:39:45 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

       You can stub this request with the following snippet:

       stub_request(:get, "http://example.com/page_without_title").
         with(
           headers: {
          'Accept'=>'text/html',
          'Accept-Encoding'=>'gzip',
          'Connection'=>'close',
          'Date'=>'Mon, 19 Aug 2024 12:39:45 GMT',
          'Host'=>'example.com',
          'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
           }).
         to_return(status: 200, body: "", headers: {})

       ============================================================
     # ./app/lib/request.rb:108:in `perform'
     # ./app/services/fetch_link_card_service.rb:48:in `html'
     # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
     # ./app/services/fetch_link_card_service.rb:42:in `process_url'
     # ./app/services/fetch_link_card_service.rb:28:in `block in call'
     # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
     # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
     # ./app/lib/redis_configuration.rb:10:in `with'
     # ./app/models/concerns/redisable.rb:9:in `with_redis'
     # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
     # ./app/services/fetch_link_card_service.rb:26:in `call'
     # ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:40:in `block (2 levels) in <top (required)>'
     # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |==============

  8) FetchLinkCardService with a local status with URL of a regular HTML page creates preview card
     Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

     WebMock::NetConnectNotAllowedError:
       Real HTTP connections are disabled. Unregistered request: GET http://example.com/html with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:39:45 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

       You can stub this request with the following snippet:

       stub_request(:get, "http://example.com/html").
         with(
           headers: {
          'Accept'=>'text/html',
          'Accept-Encoding'=>'gzip',
          'Connection'=>'close',
          'Date'=>'Mon, 19 Aug 2024 12:39:45 GMT',
          'Host'=>'example.com',
          'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
           }).
         to_return(status: 200, body: "", headers: {})

       ============================================================
     # ./app/lib/request.rb:108:in `perform'
     # ./app/services/fetch_link_card_service.rb:48:in `html'
     # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
     # ./app/services/fetch_link_card_service.rb:42:in `process_url'
     # ./app/services/fetch_link_card_service.rb:28:in `block in call'
     # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
     # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
     # ./app/lib/redis_configuration.rb:10:in `with'
     # ./app/models/concerns/redisable.rb:9:in `with_redis'
     # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
     # ./app/services/fetch_link_card_service.rb:26:in `call'
     # ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:40:in `block (2 levels) in <top (required)>'
     # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |=================

  9) FetchLinkCardService with a local status with a URL of a page that includes a canonical URL too long for PostgreSQL unique indexes does not create a preview card
     Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

     WebMock::NetConnectNotAllowedError:
       Real HTTP connections are disabled. Unregistered request: GET http://example.com/long_canonical_url with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:39:45 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

       You can stub this request with the following snippet:

       stub_request(:get, "http://example.com/long_canonical_url").
         with(
           headers: {
          'Accept'=>'text/html',
          'Accept-Encoding'=>'gzip',
          'Connection'=>'close',
          'Date'=>'Mon, 19 Aug 2024 12:39:45 GMT',
          'Host'=>'example.com',
          'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
           }).
         to_return(status: 200, body: "", headers: {})

       ============================================================
     # ./app/lib/request.rb:108:in `perform'
     # ./app/services/fetch_link_card_service.rb:48:in `html'
     # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
     # ./app/services/fetch_link_card_service.rb:42:in `process_url'
     # ./app/services/fetch_link_card_service.rb:28:in `block in call'
     # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
     # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
     # ./app/lib/redis_configuration.rb:10:in `with'
     # ./app/models/concerns/redisable.rb:9:in `with_redis'
     # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
     # ./app/services/fetch_link_card_service.rb:26:in `call'
     # ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:40:in `block (2 levels) in <top (required)>'
     # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |====================

  10) FetchLinkCardService with a local status with a 404 URL does not create a preview card
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/not-found with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:39:46 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/not-found").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:39:46 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:40:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |======================

  11) FetchLinkCardService with a local status with multiple URLs fetches the first valid URL
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/html with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:39:46 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/html").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:39:46 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:40:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |========================

  12) FetchLinkCardService with a local status with multiple URLs does not fetch the second valid URL
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/html with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:39:46 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/html").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:39:46 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:40:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |=========================

  13) FetchLinkCardService with a local status with a URL of a plain-text page does not create a preview card
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/text with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:39:46 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/text").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:39:46 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:40:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |===========================

  14) FetchLinkCardService with a local status with a redirect URL with faulty encoding does not create a preview card
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/aergerliche-umlaute with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:39:46 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/aergerliche-umlaute").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:39:46 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:40:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |=============================

  15) FetchLinkCardService with a local status with a URL of a page with oEmbed support creates preview card
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/html with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:39:46 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/html").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:39:46 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:40:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |===============================

  16) FetchLinkCardService with a local status with a URL of a page with oEmbed support fetches the oEmbed URL
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/html with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:39:46 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/html").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:39:46 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:40:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |==================================

  17) FetchLinkCardService with a local status with a URL of a page with oEmbed support when oEmbed endpoint cache populated but page returns 404 uses the original URL
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/oembed?url=http://example.com/html with headers {'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:39:46 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/)'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/oembed?url=http://example.com/html").
          with(
            headers: {
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:39:46 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/)'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_oembed_service.rb:84:in `fetch!'
      # ./app/services/fetch_oembed_service.rb:19:in `call'
      # ./app/services/fetch_link_card_service.rb:107:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:40:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |===================================

  18) FetchLinkCardService with a local status with a URL of a page with oEmbed support when oEmbed endpoint cache populated but page returns 404 creates preview card
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/oembed?url=http://example.com/html with headers {'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:39:46 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/)'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/oembed?url=http://example.com/html").
          with(
            headers: {
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:39:46 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/)'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_oembed_service.rb:84:in `fetch!'
      # ./app/services/fetch_oembed_service.rb:19:in `call'
      # ./app/services/fetch_link_card_service.rb:107:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:40:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |=====================================

  19) FetchLinkCardService with a local status with a URL of a page with oEmbed support when oEmbed endpoint cache populated but page returns 404 uses the cached oEmbed response
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/oembed?url=http://example.com/html with headers {'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:39:46 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/)'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/oembed?url=http://example.com/html").
          with(
            headers: {
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:39:46 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/)'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_oembed_service.rb:84:in `fetch!'
      # ./app/services/fetch_oembed_service.rb:19:in `call'
      # ./app/services/fetch_link_card_service.rb:107:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:40:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |=======================================

  20) FetchLinkCardService with a local status with a URL of a page with oEmbed support when oEmbed endpoint cache populated uses the cached oEmbed response
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/oembed?format=json&url=http://example.com/html with headers {'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:39:46 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/)'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/oembed?format=json&url=http://example.com/html").
          with(
            headers: {
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:39:46 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/)'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_oembed_service.rb:84:in `fetch!'
      # ./app/services/fetch_oembed_service.rb:19:in `call'
      # ./app/services/fetch_link_card_service.rb:107:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:40:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |=========================================

  21) FetchLinkCardService with a local status with a URL of a page with oEmbed support when oEmbed endpoint cache populated creates preview card
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/oembed?format=json&url=http://example.com/html with headers {'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:39:46 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/)'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/oembed?format=json&url=http://example.com/html").
          with(
            headers: {
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:39:46 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/)'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_oembed_service.rb:84:in `fetch!'
      # ./app/services/fetch_oembed_service.rb:19:in `call'
      # ./app/services/fetch_link_card_service.rb:107:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:40:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |==========================================

  22) FetchLinkCardService with a local status with a URL of a page in Shift JIS encoding labeled as UTF-8 decodes the HTML despite the wrong charset header
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/sjis_with_wrong_charset with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:39:46 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/sjis_with_wrong_charset").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:39:46 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:40:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |============================================

  23) FetchLinkCardService with a local status with URL of a page with no title does not create a preview card
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/html with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:39:46 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/html").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:39:46 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:40:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |==============================================

  24) FetchLinkCardService with a local status with a URL of a page in ISO-8859-1 encoding, that charlock_holmes cannot detect when encoding in http header is correct decodes the HTML
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/low_confidence_latin1 with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:39:46 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/low_confidence_latin1").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:39:46 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:40:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |================================================

  25) FetchLinkCardService with a local status with a URL of a page in ISO-8859-1 encoding, that charlock_holmes cannot detect when encoding in http header is incorrect when encoding problems appear in title tag does not create a preview card
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/latin1_posing_as_utf8_broken with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:39:46 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/latin1_posing_as_utf8_broken").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:39:46 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:40:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |===================================================

  26) FetchLinkCardService with a local status with a URL of a page in ISO-8859-1 encoding, that charlock_holmes cannot detect when encoding in http header is incorrect when encoding problems appear in unrelated tags decodes the HTML
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/latin1_posing_as_utf8_recoverable with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:39:46 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/latin1_posing_as_utf8_recoverable").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:39:46 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:40:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |====================================================

  27) FetchLinkCardService with a local status with a Japanese path URL fetches the URL
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/%E6%97%A5%E6%9C%AC%E8%AA%9E with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:39:47 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/%E6%97%A5%E6%9C%AC%E8%AA%9E").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:39:47 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:40:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |======================================================

  28) FetchLinkCardService with a local status with a broken redirect URL follows redirect
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/redirect-to-404 with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:39:47 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/redirect-to-404").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:39:47 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:40:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |========================================================

  29) FetchLinkCardService with a local status with a broken redirect URL does not create a preview card
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/redirect-to-404 with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:39:47 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/redirect-to-404").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:39:47 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:40:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |==========================================================

  30) FetchLinkCardService with a local status with a URL of a page in Windows-1251 encoding decodes the HTML
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/windows-1251 with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:39:47 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/windows-1251").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:39:47 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:40:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |===========================================================

  31) FetchLinkCardService with a local status with a caret-suffixed URL fetches the URL
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/test?data=file.gpx%5E1 with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:39:47 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/test?data=file.gpx%5E1").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:39:47 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:40:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |=============================================================

  32) FetchLinkCardService with a local status with a caret-suffixed URL does not strip the caret before fetching
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/test?data=file.gpx%5E1 with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:39:47 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/test?data=file.gpx%5E1").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:39:47 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:40:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |===============================================================

  33) FetchLinkCardService with a remote status ignores URLs to hashtags
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/not-found with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:39:47 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/not-found").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:39:47 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:40:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |=================================================================

  34) FetchLinkCardService with a remote status parses out URLs
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/not-found with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:39:47 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/not-found").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:39:47 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:40:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |====================================================================|
[TEST PROF INFO] RSpecDissect report

Total time: 00:00.959

Total `let` time: 00:00.102
Total `before(:each)` time: 00:00.146

Top 5 slowest suites (by `let` time):

FetchLinkCardService (./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:5) – 00:00.102 of 00:00.959 (36)
 ↳ oembed_cache – 41
 ↳ subject – 36
 ↳ status – 36

Top 5 slowest suites (by `before(:each)` time):

FetchLinkCardService (./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:5) – 00:00.146 of 00:00.959 (36)

Finished in 4.56 seconds (files took 10.48 seconds to load)
36 examples, 34 failures

Failed examples:

rspec ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:146 # FetchLinkCardService with a local status with a URL of a page in Shift JIS encoding decodes the HTML
rspec ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:91 # FetchLinkCardService with a local status with a redirect URL creates preview card
rspec ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:86 # FetchLinkCardService with a local status with a redirect URL follows redirect
rspec ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:162 # FetchLinkCardService with a local status with a URL of a page in KOI8-R encoding decodes the HTML
rspec ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:298 # FetchLinkCardService with a local status with a URL where the `Content-Type` header uses `utf8` instead of `utf-8` does not create a preview card
rspec ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:138 # FetchLinkCardService with a local status with an IDN URL fetches the URL
rspec ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:122 # FetchLinkCardService with a local status with a page that has no title does not create a preview card
rspec ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:47 # FetchLinkCardService with a local status with URL of a regular HTML page creates preview card
rspec ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:290 # FetchLinkCardService with a local status with a URL of a page that includes a canonical URL too long for PostgreSQL unique indexes does not create a preview card
rspec ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:130 # FetchLinkCardService with a local status with a 404 URL does not create a preview card
rspec ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:74 # FetchLinkCardService with a local status with multiple URLs fetches the first valid URL
rspec ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:78 # FetchLinkCardService with a local status with multiple URLs does not fetch the second valid URL
rspec ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:66 # FetchLinkCardService with a local status with a URL of a plain-text page does not create a preview card
rspec ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:114 # FetchLinkCardService with a local status with a redirect URL with faulty encoding does not create a preview card
rspec ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:247 # FetchLinkCardService with a local status with a URL of a page with oEmbed support creates preview card
rspec ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:243 # FetchLinkCardService with a local status with a URL of a page with oEmbed support fetches the oEmbed URL
rspec ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:281 # FetchLinkCardService with a local status with a URL of a page with oEmbed support when oEmbed endpoint cache populated but page returns 404 uses the original URL
rspec ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:276 # FetchLinkCardService with a local status with a URL of a page with oEmbed support when oEmbed endpoint cache populated but page returns 404 creates preview card
rspec ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:272 # FetchLinkCardService with a local status with a URL of a page with oEmbed support when oEmbed endpoint cache populated but page returns 404 uses the cached oEmbed response
rspec ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:256 # FetchLinkCardService with a local status with a URL of a page with oEmbed support when oEmbed endpoint cache populated uses the cached oEmbed response
rspec ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:261 # FetchLinkCardService with a local status with a URL of a page with oEmbed support when oEmbed endpoint cache populated creates preview card
rspec ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:154 # FetchLinkCardService with a local status with a URL of a page in Shift JIS encoding labeled as UTF-8 decodes the HTML despite the wrong charset header
rspec ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:58 # FetchLinkCardService with a local status with URL of a page with no title does not create a preview card
rspec ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:179 # FetchLinkCardService with a local status with a URL of a page in ISO-8859-1 encoding, that charlock_holmes cannot detect when encoding in http header is correct decodes the HTML
rspec ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:196 # FetchLinkCardService with a local status with a URL of a page in ISO-8859-1 encoding, that charlock_holmes cannot detect when encoding in http header is incorrect when encoding problems appear in title tag does not create a preview card
rspec ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:188 # FetchLinkCardService with a local status with a URL of a page in ISO-8859-1 encoding, that charlock_holmes cannot detect when encoding in http header is incorrect when encoding problems appear in unrelated tags decodes the HTML
rspec ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:206 # FetchLinkCardService with a local status with a Japanese path URL fetches the URL
rspec ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:101 # FetchLinkCardService with a local status with a broken redirect URL follows redirect
rspec ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:106 # FetchLinkCardService with a local status with a broken redirect URL does not create a preview card
rspec ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:170 # FetchLinkCardService with a local status with a URL of a page in Windows-1251 encoding decodes the HTML
rspec ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:222 # FetchLinkCardService with a local status with a caret-suffixed URL fetches the URL
rspec ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:226 # FetchLinkCardService with a local status with a caret-suffixed URL does not strip the caret before fetching
rspec ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:318 # FetchLinkCardService with a remote status ignores URLs to hashtags
rspec ./spec/services/fetch_link_card_service_ai_suggest_1_spec.rb:314 # FetchLinkCardService with a remote status parses out URLs

Randomized with seed 13172
[TEST PROF INFO] Factories usage

 Total: 27
 Total top-level: 27
 Total time: 00:02.328 (out of 00:11.297)
 Total uniq factories: 2

   name                    total   top-level     total time      time per call      top-level time

   status                     26          26        2.2193s            0.0854s             2.2193s
   account                     1           1        0.1087s            0.1087s             0.1087s
github-actions[bot] commented 2 months ago

🤖 Thought: The tests are failing due to WebMock errors. It seems that the HTTP requests are not properly stubbed. We need to update the test setup to properly stub these requests.

Here are the results of running an updated version:

[TEST PROF INFO] FactoryProf enabled (simple mode)
[TEST PROF INFO] RSpecDissect enabled

Run options: exclude {:streaming=>true, :search=>true, :js=>true}

Randomized with seed 3056

Progress: |=

  1) FetchLinkCardService with a local status with a redirect URL follows redirect
     Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

     WebMock::NetConnectNotAllowedError:
       Real HTTP connections are disabled. Unregistered request: GET http://example.com/redirect with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:41:04 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

       You can stub this request with the following snippet:

       stub_request(:get, "http://example.com/redirect").
         with(
           headers: {
          'Accept'=>'text/html',
          'Accept-Encoding'=>'gzip',
          'Connection'=>'close',
          'Date'=>'Mon, 19 Aug 2024 12:41:04 GMT',
          'Host'=>'example.com',
          'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
           }).
         to_return(status: 200, body: "", headers: {})

       ============================================================
     # ./app/lib/request.rb:108:in `perform'
     # ./app/services/fetch_link_card_service.rb:48:in `html'
     # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
     # ./app/services/fetch_link_card_service.rb:42:in `process_url'
     # ./app/services/fetch_link_card_service.rb:28:in `block in call'
     # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
     # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
     # ./app/lib/redis_configuration.rb:10:in `with'
     # ./app/models/concerns/redisable.rb:9:in `with_redis'
     # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
     # ./app/services/fetch_link_card_service.rb:26:in `call'
     # ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:23:in `block (2 levels) in <top (required)>'
     # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |===

  2) FetchLinkCardService with a local status with a broken redirect URL follows redirect
     Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

     WebMock::NetConnectNotAllowedError:
       Real HTTP connections are disabled. Unregistered request: GET http://example.com/redirect-to-404 with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:41:04 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

       You can stub this request with the following snippet:

       stub_request(:get, "http://example.com/redirect-to-404").
         with(
           headers: {
          'Accept'=>'text/html',
          'Accept-Encoding'=>'gzip',
          'Connection'=>'close',
          'Date'=>'Mon, 19 Aug 2024 12:41:04 GMT',
          'Host'=>'example.com',
          'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
           }).
         to_return(status: 200, body: "", headers: {})

       ============================================================
     # ./app/lib/request.rb:108:in `perform'
     # ./app/services/fetch_link_card_service.rb:48:in `html'
     # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
     # ./app/services/fetch_link_card_service.rb:42:in `process_url'
     # ./app/services/fetch_link_card_service.rb:28:in `block in call'
     # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
     # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
     # ./app/lib/redis_configuration.rb:10:in `with'
     # ./app/models/concerns/redisable.rb:9:in `with_redis'
     # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
     # ./app/services/fetch_link_card_service.rb:26:in `call'
     # ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:23:in `block (2 levels) in <top (required)>'
     # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |=====

  3) FetchLinkCardService with a local status with a broken redirect URL does not create a preview card
     Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

     WebMock::NetConnectNotAllowedError:
       Real HTTP connections are disabled. Unregistered request: GET http://example.com/redirect-to-404 with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:41:04 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

       You can stub this request with the following snippet:

       stub_request(:get, "http://example.com/redirect-to-404").
         with(
           headers: {
          'Accept'=>'text/html',
          'Accept-Encoding'=>'gzip',
          'Connection'=>'close',
          'Date'=>'Mon, 19 Aug 2024 12:41:04 GMT',
          'Host'=>'example.com',
          'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
           }).
         to_return(status: 200, body: "", headers: {})

       ============================================================
     # ./app/lib/request.rb:108:in `perform'
     # ./app/services/fetch_link_card_service.rb:48:in `html'
     # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
     # ./app/services/fetch_link_card_service.rb:42:in `process_url'
     # ./app/services/fetch_link_card_service.rb:28:in `block in call'
     # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
     # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
     # ./app/lib/redis_configuration.rb:10:in `with'
     # ./app/models/concerns/redisable.rb:9:in `with_redis'
     # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
     # ./app/services/fetch_link_card_service.rb:26:in `call'
     # ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:23:in `block (2 levels) in <top (required)>'
     # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |=======

  4) FetchLinkCardService with a local status with a 404 URL does not create a preview card
     Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

     WebMock::NetConnectNotAllowedError:
       Real HTTP connections are disabled. Unregistered request: GET http://example.com/not-found with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:41:04 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

       You can stub this request with the following snippet:

       stub_request(:get, "http://example.com/not-found").
         with(
           headers: {
          'Accept'=>'text/html',
          'Accept-Encoding'=>'gzip',
          'Connection'=>'close',
          'Date'=>'Mon, 19 Aug 2024 12:41:04 GMT',
          'Host'=>'example.com',
          'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
           }).
         to_return(status: 200, body: "", headers: {})

       ============================================================
     # ./app/lib/request.rb:108:in `perform'
     # ./app/services/fetch_link_card_service.rb:48:in `html'
     # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
     # ./app/services/fetch_link_card_service.rb:42:in `process_url'
     # ./app/services/fetch_link_card_service.rb:28:in `block in call'
     # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
     # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
     # ./app/lib/redis_configuration.rb:10:in `with'
     # ./app/models/concerns/redisable.rb:9:in `with_redis'
     # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
     # ./app/services/fetch_link_card_service.rb:26:in `call'
     # ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:23:in `block (2 levels) in <top (required)>'
     # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |========

  5) FetchLinkCardService with a local status with a URL of a page in Shift JIS encoding labeled as UTF-8 decodes the HTML despite the wrong charset header
     Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

     WebMock::NetConnectNotAllowedError:
       Real HTTP connections are disabled. Unregistered request: GET http://example.com/sjis_with_wrong_charset with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:41:05 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

       You can stub this request with the following snippet:

       stub_request(:get, "http://example.com/sjis_with_wrong_charset").
         with(
           headers: {
          'Accept'=>'text/html',
          'Accept-Encoding'=>'gzip',
          'Connection'=>'close',
          'Date'=>'Mon, 19 Aug 2024 12:41:05 GMT',
          'Host'=>'example.com',
          'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
           }).
         to_return(status: 200, body: "", headers: {})

       ============================================================
     # ./app/lib/request.rb:108:in `perform'
     # ./app/services/fetch_link_card_service.rb:48:in `html'
     # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
     # ./app/services/fetch_link_card_service.rb:42:in `process_url'
     # ./app/services/fetch_link_card_service.rb:28:in `block in call'
     # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
     # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
     # ./app/lib/redis_configuration.rb:10:in `with'
     # ./app/models/concerns/redisable.rb:9:in `with_redis'
     # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
     # ./app/services/fetch_link_card_service.rb:26:in `call'
     # ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:23:in `block (2 levels) in <top (required)>'
     # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |==========

  6) FetchLinkCardService with a local status with a URL of a plain-text page does not create a preview card
     Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

     WebMock::NetConnectNotAllowedError:
       Real HTTP connections are disabled. Unregistered request: GET http://example.com/text with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:41:05 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

       You can stub this request with the following snippet:

       stub_request(:get, "http://example.com/text").
         with(
           headers: {
          'Accept'=>'text/html',
          'Accept-Encoding'=>'gzip',
          'Connection'=>'close',
          'Date'=>'Mon, 19 Aug 2024 12:41:05 GMT',
          'Host'=>'example.com',
          'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
           }).
         to_return(status: 200, body: "", headers: {})

       ============================================================
     # ./app/lib/request.rb:108:in `perform'
     # ./app/services/fetch_link_card_service.rb:48:in `html'
     # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
     # ./app/services/fetch_link_card_service.rb:42:in `process_url'
     # ./app/services/fetch_link_card_service.rb:28:in `block in call'
     # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
     # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
     # ./app/lib/redis_configuration.rb:10:in `with'
     # ./app/models/concerns/redisable.rb:9:in `with_redis'
     # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
     # ./app/services/fetch_link_card_service.rb:26:in `call'
     # ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:23:in `block (2 levels) in <top (required)>'
     # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |============

  7) FetchLinkCardService with a local status with a URL of a page with oEmbed support fetches the oEmbed URL
     Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

     WebMock::NetConnectNotAllowedError:
       Real HTTP connections are disabled. Unregistered request: GET http://example.com/html with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:41:05 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

       You can stub this request with the following snippet:

       stub_request(:get, "http://example.com/html").
         with(
           headers: {
          'Accept'=>'text/html',
          'Accept-Encoding'=>'gzip',
          'Connection'=>'close',
          'Date'=>'Mon, 19 Aug 2024 12:41:05 GMT',
          'Host'=>'example.com',
          'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
           }).
         to_return(status: 200, body: "", headers: {})

       ============================================================
     # ./app/lib/request.rb:108:in `perform'
     # ./app/services/fetch_link_card_service.rb:48:in `html'
     # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
     # ./app/services/fetch_link_card_service.rb:42:in `process_url'
     # ./app/services/fetch_link_card_service.rb:28:in `block in call'
     # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
     # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
     # ./app/lib/redis_configuration.rb:10:in `with'
     # ./app/models/concerns/redisable.rb:9:in `with_redis'
     # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
     # ./app/services/fetch_link_card_service.rb:26:in `call'
     # ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:23:in `block (2 levels) in <top (required)>'
     # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |==============

  8) FetchLinkCardService with a local status with a URL of a page with oEmbed support creates preview card
     Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

     WebMock::NetConnectNotAllowedError:
       Real HTTP connections are disabled. Unregistered request: GET http://example.com/html with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:41:05 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

       You can stub this request with the following snippet:

       stub_request(:get, "http://example.com/html").
         with(
           headers: {
          'Accept'=>'text/html',
          'Accept-Encoding'=>'gzip',
          'Connection'=>'close',
          'Date'=>'Mon, 19 Aug 2024 12:41:05 GMT',
          'Host'=>'example.com',
          'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
           }).
         to_return(status: 200, body: "", headers: {})

       ============================================================
     # ./app/lib/request.rb:108:in `perform'
     # ./app/services/fetch_link_card_service.rb:48:in `html'
     # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
     # ./app/services/fetch_link_card_service.rb:42:in `process_url'
     # ./app/services/fetch_link_card_service.rb:28:in `block in call'
     # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
     # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
     # ./app/lib/redis_configuration.rb:10:in `with'
     # ./app/models/concerns/redisable.rb:9:in `with_redis'
     # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
     # ./app/services/fetch_link_card_service.rb:26:in `call'
     # ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:23:in `block (2 levels) in <top (required)>'
     # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |=================

  9) FetchLinkCardService with a local status with a URL of a page with oEmbed support when oEmbed endpoint cache populated uses the cached oEmbed response
     Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

     WebMock::NetConnectNotAllowedError:
       Real HTTP connections are disabled. Unregistered request: GET http://example.com/oembed?format=json&url=http://example.com/html with headers {'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:41:05 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/)'}

       You can stub this request with the following snippet:

       stub_request(:get, "http://example.com/oembed?format=json&url=http://example.com/html").
         with(
           headers: {
          'Accept-Encoding'=>'gzip',
          'Connection'=>'close',
          'Date'=>'Mon, 19 Aug 2024 12:41:05 GMT',
          'Host'=>'example.com',
          'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/)'
           }).
         to_return(status: 200, body: "", headers: {})

       ============================================================
     # ./app/lib/request.rb:108:in `perform'
     # ./app/services/fetch_oembed_service.rb:84:in `fetch!'
     # ./app/services/fetch_oembed_service.rb:19:in `call'
     # ./app/services/fetch_link_card_service.rb:107:in `attempt_oembed'
     # ./app/services/fetch_link_card_service.rb:42:in `process_url'
     # ./app/services/fetch_link_card_service.rb:28:in `block in call'
     # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
     # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
     # ./app/lib/redis_configuration.rb:10:in `with'
     # ./app/models/concerns/redisable.rb:9:in `with_redis'
     # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
     # ./app/services/fetch_link_card_service.rb:26:in `call'
     # ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:23:in `block (2 levels) in <top (required)>'
     # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |==================

  10) FetchLinkCardService with a local status with a URL of a page with oEmbed support when oEmbed endpoint cache populated creates preview card
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/oembed?format=json&url=http://example.com/html with headers {'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:41:05 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/)'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/oembed?format=json&url=http://example.com/html").
          with(
            headers: {
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:41:05 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/)'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_oembed_service.rb:84:in `fetch!'
      # ./app/services/fetch_oembed_service.rb:19:in `call'
      # ./app/services/fetch_link_card_service.rb:107:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:23:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |====================

  11) FetchLinkCardService with a local status with a URL of a page with oEmbed support when oEmbed endpoint cache populated but page returns 404 uses the cached oEmbed response
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/oembed?url=http://example.com/html with headers {'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:41:05 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/)'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/oembed?url=http://example.com/html").
          with(
            headers: {
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:41:05 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/)'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_oembed_service.rb:84:in `fetch!'
      # ./app/services/fetch_oembed_service.rb:19:in `call'
      # ./app/services/fetch_link_card_service.rb:107:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:23:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |======================

  12) FetchLinkCardService with a local status with a URL of a page with oEmbed support when oEmbed endpoint cache populated but page returns 404 creates preview card
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/oembed?url=http://example.com/html with headers {'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:41:05 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/)'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/oembed?url=http://example.com/html").
          with(
            headers: {
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:41:05 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/)'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_oembed_service.rb:84:in `fetch!'
      # ./app/services/fetch_oembed_service.rb:19:in `call'
      # ./app/services/fetch_link_card_service.rb:107:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:23:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |========================

  13) FetchLinkCardService with a local status with a URL of a page with oEmbed support when oEmbed endpoint cache populated but page returns 404 uses the original URL
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/oembed?url=http://example.com/html with headers {'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:41:05 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/)'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/oembed?url=http://example.com/html").
          with(
            headers: {
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:41:05 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/)'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_oembed_service.rb:84:in `fetch!'
      # ./app/services/fetch_oembed_service.rb:19:in `call'
      # ./app/services/fetch_link_card_service.rb:107:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:23:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |=========================

  14) FetchLinkCardService with a local status with a URL of a page that includes a canonical URL too long for PostgreSQL unique indexes does not create a preview card
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/long_canonical_url with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:41:05 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/long_canonical_url").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:41:05 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:23:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |===========================

  15) FetchLinkCardService with a local status with a hyphen-suffixed URL fetches the URL
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/test- with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:41:05 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/test-").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:41:05 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:23:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |=============================

  16) FetchLinkCardService with a local status with a redirect URL with faulty encoding does not create a preview card
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/aergerliche-umlaute with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:41:06 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/aergerliche-umlaute").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:41:06 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:23:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |===============================

  17) FetchLinkCardService with a local status with a caret-suffixed URL fetches the URL
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/test?data=file.gpx%5E1 with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:41:06 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/test?data=file.gpx%5E1").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:41:06 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:23:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |==================================

  18) FetchLinkCardService with a local status with a caret-suffixed URL does not strip the caret before fetching
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/test?data=file.gpx%5E1 with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:41:06 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/test?data=file.gpx%5E1").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:41:06 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:23:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |===================================

  19) FetchLinkCardService with a local status with multiple URLs does not fetch the second valid URL
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/html with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:41:06 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/html").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:41:06 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:23:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |=====================================

  20) FetchLinkCardService with a local status with multiple URLs fetches the first valid URL
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/html with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:41:06 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/html").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:41:06 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:23:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |=======================================

  21) FetchLinkCardService with a local status with a page that has no title does not create a preview card
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/page_without_title with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:41:06 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/page_without_title").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:41:06 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:23:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |=========================================

  22) FetchLinkCardService with a local status with a URL of a page in ISO-8859-1 encoding, that charlock_holmes cannot detect when encoding in http header is correct decodes the HTML
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/low_confidence_latin1 with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:41:06 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/low_confidence_latin1").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:41:06 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:23:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |==========================================

  23) FetchLinkCardService with a local status with a URL of a page in ISO-8859-1 encoding, that charlock_holmes cannot detect when encoding in http header is incorrect when encoding problems appear in title tag does not create a preview card
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/latin1_posing_as_utf8_broken with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:41:06 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/latin1_posing_as_utf8_broken").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:41:06 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:23:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |============================================

  24) FetchLinkCardService with a local status with a URL of a page in ISO-8859-1 encoding, that charlock_holmes cannot detect when encoding in http header is incorrect when encoding problems appear in unrelated tags decodes the HTML
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/latin1_posing_as_utf8_recoverable with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:41:06 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/latin1_posing_as_utf8_recoverable").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:41:06 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:23:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |==============================================

  25) FetchLinkCardService with a local status with a URL of a page in KOI8-R encoding decodes the HTML
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/koi8-r with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:41:06 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/koi8-r").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:41:06 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:23:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |===================================================

  26) FetchLinkCardService with a local status with URL of a regular HTML page creates preview card
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/html with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:41:06 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/html").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:41:06 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:23:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |====================================================

  27) FetchLinkCardService with a local status with a URL where the `Content-Type` header uses `utf8` instead of `utf-8` creates a preview card
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/alternative_utf8_spelling_in_header with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:41:06 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/alternative_utf8_spelling_in_header").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:41:06 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:23:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |======================================================

  28) FetchLinkCardService with a local status with an IDN URL fetches the URL
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.xn--fiqs8s/ with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:41:06 GMT', 'Host'=>'example.xn--fiqs8s', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.xn--fiqs8s/").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:41:06 GMT',
              'Host'=>'example.xn--fiqs8s',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:23:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |========================================================

  29) FetchLinkCardService with a local status with a Japanese path URL fetches the URL
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/%E6%97%A5%E6%9C%AC%E8%AA%9E with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:41:06 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/%E6%97%A5%E6%9C%AC%E8%AA%9E").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:41:06 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:23:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |==========================================================

  30) FetchLinkCardService with a local status with URL of a page with no title does not create a preview card
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/html with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:41:07 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/html").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:41:07 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:23:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |===========================================================

  31) FetchLinkCardService with a local status with a URL of a page in Shift JIS encoding decodes the HTML
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/sjis with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:41:07 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/sjis").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:41:07 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:23:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |=============================================================

  32) FetchLinkCardService with a local status with a URL of a page in Windows-1251 encoding decodes the HTML
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/windows-1251 with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:41:07 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/windows-1251").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:41:07 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:23:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |===============================================================

  33) FetchLinkCardService with a remote status parses out URLs
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/not-found with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:41:07 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/not-found").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:41:07 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:23:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |=================================================================

  34) FetchLinkCardService with a remote status ignores URLs to hashtags
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/not-found with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:41:07 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/not-found").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:41:07 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:23:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |====================================================================|
[TEST PROF INFO] RSpecDissect report

Total time: 00:01.094

Total `let` time: 00:00.116
Total `before(:each)` time: 00:00.232

Top 5 slowest suites (by `let` time):

FetchLinkCardService (./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:5) – 00:00.116 of 00:01.094 (36)
 ↳ oembed_cache – 41
 ↳ status – 39
 ↳ subject – 36

Top 5 slowest suites (by `before(:each)` time):

FetchLinkCardService (./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:5) – 00:00.232 of 00:01.094 (36)

Finished in 5.11 seconds (files took 11.22 seconds to load)
36 examples, 34 failures

Failed examples:

rspec ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:69 # FetchLinkCardService with a local status with a redirect URL follows redirect
rspec ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:84 # FetchLinkCardService with a local status with a broken redirect URL follows redirect
rspec ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:89 # FetchLinkCardService with a local status with a broken redirect URL does not create a preview card
rspec ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:113 # FetchLinkCardService with a local status with a 404 URL does not create a preview card
rspec ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:137 # FetchLinkCardService with a local status with a URL of a page in Shift JIS encoding labeled as UTF-8 decodes the HTML despite the wrong charset header
rspec ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:49 # FetchLinkCardService with a local status with a URL of a plain-text page does not create a preview card
rspec ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:226 # FetchLinkCardService with a local status with a URL of a page with oEmbed support fetches the oEmbed URL
rspec ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:230 # FetchLinkCardService with a local status with a URL of a page with oEmbed support creates preview card
rspec ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:239 # FetchLinkCardService with a local status with a URL of a page with oEmbed support when oEmbed endpoint cache populated uses the cached oEmbed response
rspec ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:244 # FetchLinkCardService with a local status with a URL of a page with oEmbed support when oEmbed endpoint cache populated creates preview card
rspec ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:255 # FetchLinkCardService with a local status with a URL of a page with oEmbed support when oEmbed endpoint cache populated but page returns 404 uses the cached oEmbed response
rspec ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:259 # FetchLinkCardService with a local status with a URL of a page with oEmbed support when oEmbed endpoint cache populated but page returns 404 creates preview card
rspec ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:264 # FetchLinkCardService with a local status with a URL of a page with oEmbed support when oEmbed endpoint cache populated but page returns 404 uses the original URL
rspec ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:273 # FetchLinkCardService with a local status with a URL of a page that includes a canonical URL too long for PostgreSQL unique indexes does not create a preview card
rspec ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:197 # FetchLinkCardService with a local status with a hyphen-suffixed URL fetches the URL
rspec ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:97 # FetchLinkCardService with a local status with a redirect URL with faulty encoding does not create a preview card
rspec ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:205 # FetchLinkCardService with a local status with a caret-suffixed URL fetches the URL
rspec ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:209 # FetchLinkCardService with a local status with a caret-suffixed URL does not strip the caret before fetching
rspec ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:61 # FetchLinkCardService with a local status with multiple URLs does not fetch the second valid URL
rspec ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:57 # FetchLinkCardService with a local status with multiple URLs fetches the first valid URL
rspec ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:105 # FetchLinkCardService with a local status with a page that has no title does not create a preview card
rspec ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:162 # FetchLinkCardService with a local status with a URL of a page in ISO-8859-1 encoding, that charlock_holmes cannot detect when encoding in http header is correct decodes the HTML
rspec ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:179 # FetchLinkCardService with a local status with a URL of a page in ISO-8859-1 encoding, that charlock_holmes cannot detect when encoding in http header is incorrect when encoding problems appear in title tag does not create a preview card
rspec ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:171 # FetchLinkCardService with a local status with a URL of a page in ISO-8859-1 encoding, that charlock_holmes cannot detect when encoding in http header is incorrect when encoding problems appear in unrelated tags decodes the HTML
rspec ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:145 # FetchLinkCardService with a local status with a URL of a page in KOI8-R encoding decodes the HTML
rspec ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:30 # FetchLinkCardService with a local status with URL of a regular HTML page creates preview card
rspec ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:281 # FetchLinkCardService with a local status with a URL where the `Content-Type` header uses `utf8` instead of `utf-8` creates a preview card
rspec ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:121 # FetchLinkCardService with a local status with an IDN URL fetches the URL
rspec ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:189 # FetchLinkCardService with a local status with a Japanese path URL fetches the URL
rspec ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:41 # FetchLinkCardService with a local status with URL of a page with no title does not create a preview card
rspec ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:129 # FetchLinkCardService with a local status with a URL of a page in Shift JIS encoding decodes the HTML
rspec ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:153 # FetchLinkCardService with a local status with a URL of a page in Windows-1251 encoding decodes the HTML
rspec ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:297 # FetchLinkCardService with a remote status parses out URLs
rspec ./spec/services/fetch_link_card_service_ai_suggest_2_spec.rb:301 # FetchLinkCardService with a remote status ignores URLs to hashtags

Randomized with seed 3056
[TEST PROF INFO] Factories usage

 Total: 27
 Total top-level: 27
 Total time: 00:02.767 (out of 00:12.048)
 Total uniq factories: 2

   name                    total   top-level     total time      time per call      top-level time

   status                     26          26        2.6597s            0.1023s             2.6597s
   account                     1           1        0.1073s            0.1073s             0.1073s
github-actions[bot] commented 2 months ago

🤖 Thought: The tests are still failing due to WebMock errors. It seems that the stubbed requests are not matching the actual requests made by the service. We need to update our stub_request calls to match the exact requests being made, including headers.

Here are the results of running an updated version:

[TEST PROF INFO] FactoryProf enabled (simple mode)
[TEST PROF INFO] RSpecDissect enabled

Run options: exclude {:streaming=>true, :search=>true, :js=>true}

Randomized with seed 17675

Progress: |=

  1) FetchLinkCardService with a local status with a redirect URL with faulty encoding does not create a preview card
     Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

     WebMock::NetConnectNotAllowedError:
       Real HTTP connections are disabled. Unregistered request: GET http://example.com/aergerliche-umlaute with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:42:39 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

       You can stub this request with the following snippet:

       stub_request(:get, "http://example.com/aergerliche-umlaute").
         with(
           headers: {
          'Accept'=>'text/html',
          'Accept-Encoding'=>'gzip',
          'Connection'=>'close',
          'Date'=>'Mon, 19 Aug 2024 12:42:39 GMT',
          'Host'=>'example.com',
          'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
           }).
         to_return(status: 200, body: "", headers: {})

       ============================================================
     # ./app/lib/request.rb:108:in `perform'
     # ./app/services/fetch_link_card_service.rb:48:in `html'
     # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
     # ./app/services/fetch_link_card_service.rb:42:in `process_url'
     # ./app/services/fetch_link_card_service.rb:28:in `block in call'
     # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
     # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
     # ./app/lib/redis_configuration.rb:10:in `with'
     # ./app/models/concerns/redisable.rb:9:in `with_redis'
     # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
     # ./app/services/fetch_link_card_service.rb:26:in `call'
     # ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:83:in `block (2 levels) in <top (required)>'
     # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |===

  2) FetchLinkCardService with a local status with URL of a page with no title does not create a preview card
     Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

     WebMock::NetConnectNotAllowedError:
       Real HTTP connections are disabled. Unregistered request: GET http://example.com/html with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:42:39 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

       You can stub this request with the following snippet:

       stub_request(:get, "http://example.com/html").
         with(
           headers: {
          'Accept'=>'text/html',
          'Accept-Encoding'=>'gzip',
          'Connection'=>'close',
          'Date'=>'Mon, 19 Aug 2024 12:42:39 GMT',
          'Host'=>'example.com',
          'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
           }).
         to_return(status: 200, body: "", headers: {})

       ============================================================
     # ./app/lib/request.rb:108:in `perform'
     # ./app/services/fetch_link_card_service.rb:48:in `html'
     # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
     # ./app/services/fetch_link_card_service.rb:42:in `process_url'
     # ./app/services/fetch_link_card_service.rb:28:in `block in call'
     # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
     # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
     # ./app/lib/redis_configuration.rb:10:in `with'
     # ./app/models/concerns/redisable.rb:9:in `with_redis'
     # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
     # ./app/services/fetch_link_card_service.rb:26:in `call'
     # ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:83:in `block (2 levels) in <top (required)>'
     # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |=====

  3) FetchLinkCardService with a local status with a URL of a page with oEmbed support creates preview card
     Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

     WebMock::NetConnectNotAllowedError:
       Real HTTP connections are disabled. Unregistered request: GET http://example.com/html with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:42:40 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

       You can stub this request with the following snippet:

       stub_request(:get, "http://example.com/html").
         with(
           headers: {
          'Accept'=>'text/html',
          'Accept-Encoding'=>'gzip',
          'Connection'=>'close',
          'Date'=>'Mon, 19 Aug 2024 12:42:40 GMT',
          'Host'=>'example.com',
          'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
           }).
         to_return(status: 200, body: "", headers: {})

       ============================================================
     # ./app/lib/request.rb:108:in `perform'
     # ./app/services/fetch_link_card_service.rb:48:in `html'
     # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
     # ./app/services/fetch_link_card_service.rb:42:in `process_url'
     # ./app/services/fetch_link_card_service.rb:28:in `block in call'
     # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
     # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
     # ./app/lib/redis_configuration.rb:10:in `with'
     # ./app/models/concerns/redisable.rb:9:in `with_redis'
     # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
     # ./app/services/fetch_link_card_service.rb:26:in `call'
     # ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:83:in `block (2 levels) in <top (required)>'
     # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |=======

  4) FetchLinkCardService with a local status with a URL of a page with oEmbed support fetches the oEmbed URL
     Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

     WebMock::NetConnectNotAllowedError:
       Real HTTP connections are disabled. Unregistered request: GET http://example.com/html with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:42:40 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

       You can stub this request with the following snippet:

       stub_request(:get, "http://example.com/html").
         with(
           headers: {
          'Accept'=>'text/html',
          'Accept-Encoding'=>'gzip',
          'Connection'=>'close',
          'Date'=>'Mon, 19 Aug 2024 12:42:40 GMT',
          'Host'=>'example.com',
          'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
           }).
         to_return(status: 200, body: "", headers: {})

       ============================================================
     # ./app/lib/request.rb:108:in `perform'
     # ./app/services/fetch_link_card_service.rb:48:in `html'
     # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
     # ./app/services/fetch_link_card_service.rb:42:in `process_url'
     # ./app/services/fetch_link_card_service.rb:28:in `block in call'
     # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
     # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
     # ./app/lib/redis_configuration.rb:10:in `with'
     # ./app/models/concerns/redisable.rb:9:in `with_redis'
     # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
     # ./app/services/fetch_link_card_service.rb:26:in `call'
     # ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:83:in `block (2 levels) in <top (required)>'
     # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |========

  5) FetchLinkCardService with a local status with a URL of a page with oEmbed support when oEmbed endpoint cache populated but page returns 404 uses the original URL
     Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

     WebMock::NetConnectNotAllowedError:
       Real HTTP connections are disabled. Unregistered request: GET http://example.com/oembed?url=http://example.com/html with headers {'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:42:40 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/)'}

       You can stub this request with the following snippet:

       stub_request(:get, "http://example.com/oembed?url=http://example.com/html").
         with(
           headers: {
          'Accept-Encoding'=>'gzip',
          'Connection'=>'close',
          'Date'=>'Mon, 19 Aug 2024 12:42:40 GMT',
          'Host'=>'example.com',
          'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/)'
           }).
         to_return(status: 200, body: "", headers: {})

       ============================================================
     # ./app/lib/request.rb:108:in `perform'
     # ./app/services/fetch_oembed_service.rb:84:in `fetch!'
     # ./app/services/fetch_oembed_service.rb:19:in `call'
     # ./app/services/fetch_link_card_service.rb:107:in `attempt_oembed'
     # ./app/services/fetch_link_card_service.rb:42:in `process_url'
     # ./app/services/fetch_link_card_service.rb:28:in `block in call'
     # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
     # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
     # ./app/lib/redis_configuration.rb:10:in `with'
     # ./app/models/concerns/redisable.rb:9:in `with_redis'
     # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
     # ./app/services/fetch_link_card_service.rb:26:in `call'
     # ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:83:in `block (2 levels) in <top (required)>'
     # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |==========

  6) FetchLinkCardService with a local status with a URL of a page with oEmbed support when oEmbed endpoint cache populated but page returns 404 creates preview card
     Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

     WebMock::NetConnectNotAllowedError:
       Real HTTP connections are disabled. Unregistered request: GET http://example.com/oembed?url=http://example.com/html with headers {'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:42:40 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/)'}

       You can stub this request with the following snippet:

       stub_request(:get, "http://example.com/oembed?url=http://example.com/html").
         with(
           headers: {
          'Accept-Encoding'=>'gzip',
          'Connection'=>'close',
          'Date'=>'Mon, 19 Aug 2024 12:42:40 GMT',
          'Host'=>'example.com',
          'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/)'
           }).
         to_return(status: 200, body: "", headers: {})

       ============================================================
     # ./app/lib/request.rb:108:in `perform'
     # ./app/services/fetch_oembed_service.rb:84:in `fetch!'
     # ./app/services/fetch_oembed_service.rb:19:in `call'
     # ./app/services/fetch_link_card_service.rb:107:in `attempt_oembed'
     # ./app/services/fetch_link_card_service.rb:42:in `process_url'
     # ./app/services/fetch_link_card_service.rb:28:in `block in call'
     # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
     # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
     # ./app/lib/redis_configuration.rb:10:in `with'
     # ./app/models/concerns/redisable.rb:9:in `with_redis'
     # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
     # ./app/services/fetch_link_card_service.rb:26:in `call'
     # ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:83:in `block (2 levels) in <top (required)>'
     # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |============

  7) FetchLinkCardService with a local status with a URL of a page with oEmbed support when oEmbed endpoint cache populated but page returns 404 uses the cached oEmbed response
     Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

     WebMock::NetConnectNotAllowedError:
       Real HTTP connections are disabled. Unregistered request: GET http://example.com/oembed?url=http://example.com/html with headers {'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:42:40 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/)'}

       You can stub this request with the following snippet:

       stub_request(:get, "http://example.com/oembed?url=http://example.com/html").
         with(
           headers: {
          'Accept-Encoding'=>'gzip',
          'Connection'=>'close',
          'Date'=>'Mon, 19 Aug 2024 12:42:40 GMT',
          'Host'=>'example.com',
          'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/)'
           }).
         to_return(status: 200, body: "", headers: {})

       ============================================================
     # ./app/lib/request.rb:108:in `perform'
     # ./app/services/fetch_oembed_service.rb:84:in `fetch!'
     # ./app/services/fetch_oembed_service.rb:19:in `call'
     # ./app/services/fetch_link_card_service.rb:107:in `attempt_oembed'
     # ./app/services/fetch_link_card_service.rb:42:in `process_url'
     # ./app/services/fetch_link_card_service.rb:28:in `block in call'
     # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
     # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
     # ./app/lib/redis_configuration.rb:10:in `with'
     # ./app/models/concerns/redisable.rb:9:in `with_redis'
     # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
     # ./app/services/fetch_link_card_service.rb:26:in `call'
     # ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:83:in `block (2 levels) in <top (required)>'
     # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |==============

  8) FetchLinkCardService with a local status with a URL of a page with oEmbed support when oEmbed endpoint cache populated creates preview card
     Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

     WebMock::NetConnectNotAllowedError:
       Real HTTP connections are disabled. Unregistered request: GET http://example.com/oembed?format=json&url=http://example.com/html with headers {'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:42:40 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/)'}

       You can stub this request with the following snippet:

       stub_request(:get, "http://example.com/oembed?format=json&url=http://example.com/html").
         with(
           headers: {
          'Accept-Encoding'=>'gzip',
          'Connection'=>'close',
          'Date'=>'Mon, 19 Aug 2024 12:42:40 GMT',
          'Host'=>'example.com',
          'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/)'
           }).
         to_return(status: 200, body: "", headers: {})

       ============================================================
     # ./app/lib/request.rb:108:in `perform'
     # ./app/services/fetch_oembed_service.rb:84:in `fetch!'
     # ./app/services/fetch_oembed_service.rb:19:in `call'
     # ./app/services/fetch_link_card_service.rb:107:in `attempt_oembed'
     # ./app/services/fetch_link_card_service.rb:42:in `process_url'
     # ./app/services/fetch_link_card_service.rb:28:in `block in call'
     # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
     # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
     # ./app/lib/redis_configuration.rb:10:in `with'
     # ./app/models/concerns/redisable.rb:9:in `with_redis'
     # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
     # ./app/services/fetch_link_card_service.rb:26:in `call'
     # ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:83:in `block (2 levels) in <top (required)>'
     # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |=================

  9) FetchLinkCardService with a local status with a URL of a page with oEmbed support when oEmbed endpoint cache populated uses the cached oEmbed response
     Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

     WebMock::NetConnectNotAllowedError:
       Real HTTP connections are disabled. Unregistered request: GET http://example.com/oembed?format=json&url=http://example.com/html with headers {'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:42:40 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/)'}

       You can stub this request with the following snippet:

       stub_request(:get, "http://example.com/oembed?format=json&url=http://example.com/html").
         with(
           headers: {
          'Accept-Encoding'=>'gzip',
          'Connection'=>'close',
          'Date'=>'Mon, 19 Aug 2024 12:42:40 GMT',
          'Host'=>'example.com',
          'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/)'
           }).
         to_return(status: 200, body: "", headers: {})

       ============================================================
     # ./app/lib/request.rb:108:in `perform'
     # ./app/services/fetch_oembed_service.rb:84:in `fetch!'
     # ./app/services/fetch_oembed_service.rb:19:in `call'
     # ./app/services/fetch_link_card_service.rb:107:in `attempt_oembed'
     # ./app/services/fetch_link_card_service.rb:42:in `process_url'
     # ./app/services/fetch_link_card_service.rb:28:in `block in call'
     # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
     # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
     # ./app/lib/redis_configuration.rb:10:in `with'
     # ./app/models/concerns/redisable.rb:9:in `with_redis'
     # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
     # ./app/services/fetch_link_card_service.rb:26:in `call'
     # ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:83:in `block (2 levels) in <top (required)>'
     # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |==================

  10) FetchLinkCardService with a local status with URL of a regular HTML page creates preview card
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/html with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:42:40 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/html").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:42:40 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:83:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |====================

  11) FetchLinkCardService with a local status with a page that has no title does not create a preview card
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/page_without_title with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:42:40 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/page_without_title").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:42:40 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:83:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |======================

  12) FetchLinkCardService with a local status with a Japanese path URL fetches the URL
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/%E6%97%A5%E6%9C%AC%E8%AA%9E with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:42:40 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/%E6%97%A5%E6%9C%AC%E8%AA%9E").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:42:40 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:83:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |========================

  13) FetchLinkCardService with a local status with a redirect URL follows redirect
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/redirect with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:42:40 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/redirect").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:42:40 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:83:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |=========================

  14) FetchLinkCardService with a local status with a redirect URL creates preview card
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/redirect with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:42:41 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/redirect").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:42:41 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:83:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |===========================

  15) FetchLinkCardService with a local status with a URL of a page in Shift JIS encoding labeled as UTF-8 decodes the HTML despite the wrong charset header
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/sjis_with_wrong_charset with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:42:41 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/sjis_with_wrong_charset").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:42:41 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:83:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |=============================

  16) FetchLinkCardService with a local status with a URL of a page in Windows-1251 encoding decodes the HTML
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/windows-1251 with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:42:41 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/windows-1251").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:42:41 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:83:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |===============================

  17) FetchLinkCardService with a local status with a URL of a page in KOI8-R encoding decodes the HTML
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/koi8-r with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:42:41 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/koi8-r").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:42:41 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:83:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |===================================

  18) FetchLinkCardService with a local status with a URL of a plain-text page does not create a preview card
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/text with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:42:41 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/text").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:42:41 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:83:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |=====================================

  19) FetchLinkCardService with a local status with a URL of a page in ISO-8859-1 encoding, that charlock_holmes cannot detect when encoding in http header is incorrect when encoding problems appear in title tag does not create a preview card
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/latin1_posing_as_utf8_broken with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:42:41 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/latin1_posing_as_utf8_broken").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:42:41 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:83:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |=======================================

  20) FetchLinkCardService with a local status with a URL of a page in ISO-8859-1 encoding, that charlock_holmes cannot detect when encoding in http header is incorrect when encoding problems appear in unrelated tags decodes the HTML
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/latin1_posing_as_utf8_recoverable with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:42:41 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/latin1_posing_as_utf8_recoverable").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:42:41 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:83:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |=========================================

  21) FetchLinkCardService with a local status with a URL of a page in ISO-8859-1 encoding, that charlock_holmes cannot detect when encoding in http header is correct decodes the HTML
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/low_confidence_latin1 with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:42:41 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/low_confidence_latin1").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:42:41 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:83:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |==========================================

  22) FetchLinkCardService with a local status with a URL of a page that includes a canonical URL too long for PostgreSQL unique indexes does not create a preview card
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/long_canonical_url with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:42:41 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/long_canonical_url").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:42:41 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:83:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |============================================

  23) FetchLinkCardService with a local status with a broken redirect URL does not create a preview card
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/redirect-to-404 with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:42:41 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/redirect-to-404").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:42:41 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:83:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |==============================================

  24) FetchLinkCardService with a local status with a broken redirect URL follows redirect
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/redirect-to-404 with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:42:41 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/redirect-to-404").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:42:41 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:83:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |================================================

  25) FetchLinkCardService with a local status with a 404 URL does not create a preview card
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/not-found with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:42:41 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/not-found").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:42:41 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:83:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |===================================================

  26) FetchLinkCardService with a local status with a URL where the `Content-Type` header uses `utf8` instead of `utf-8` creates a preview card
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/alternative_utf8_spelling_in_header with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:42:42 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/alternative_utf8_spelling_in_header").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:42:42 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:83:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |====================================================

  27) FetchLinkCardService with a local status with multiple URLs fetches the first valid URL
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/html with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:42:42 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/html").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:42:42 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:83:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |======================================================

  28) FetchLinkCardService with a local status with multiple URLs does not fetch the second valid URL
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/html with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:42:42 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/html").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:42:42 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:83:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |========================================================

  29) FetchLinkCardService with a local status with a URL of a page in Shift JIS encoding decodes the HTML
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/sjis with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:42:42 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/sjis").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:42:42 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:83:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |==========================================================

  30) FetchLinkCardService with a local status with an IDN URL fetches the URL
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.xn--fiqs8s/ with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:42:42 GMT', 'Host'=>'example.xn--fiqs8s', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.xn--fiqs8s/").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:42:42 GMT',
              'Host'=>'example.xn--fiqs8s',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:83:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |===========================================================

  31) FetchLinkCardService with a local status with a caret-suffixed URL fetches the URL
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/test?data=file.gpx%5E1 with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:42:42 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/test?data=file.gpx%5E1").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:42:42 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:83:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |=============================================================

  32) FetchLinkCardService with a local status with a caret-suffixed URL does not strip the caret before fetching
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/test?data=file.gpx%5E1 with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:42:42 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/test?data=file.gpx%5E1").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:42:42 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:83:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |===============================================================

  33) FetchLinkCardService with a remote status ignores URLs to hashtags
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/not-found with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:42:42 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/not-found").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:42:42 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:83:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |=================================================================

  34) FetchLinkCardService with a remote status parses out URLs
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/not-found with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:42:42 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/not-found").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:42:42 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:83:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |====================================================================|
[TEST PROF INFO] RSpecDissect report

Total time: 00:01.173

Total `let` time: 00:00.112
Total `before(:each)` time: 00:00.208

Top 5 slowest suites (by `let` time):

FetchLinkCardService (./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:5) – 00:00.112 of 00:01.173 (36)
 ↳ oembed_cache – 41
 ↳ subject – 36
 ↳ status – 36

Top 5 slowest suites (by `before(:each)` time):

FetchLinkCardService (./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:5) – 00:00.208 of 00:01.173 (36)

Finished in 4.76 seconds (files took 10.48 seconds to load)
36 examples, 34 failures

Failed examples:

rspec ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:157 # FetchLinkCardService with a local status with a redirect URL with faulty encoding does not create a preview card
rspec ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:101 # FetchLinkCardService with a local status with URL of a page with no title does not create a preview card
rspec ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:290 # FetchLinkCardService with a local status with a URL of a page with oEmbed support creates preview card
rspec ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:286 # FetchLinkCardService with a local status with a URL of a page with oEmbed support fetches the oEmbed URL
rspec ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:324 # FetchLinkCardService with a local status with a URL of a page with oEmbed support when oEmbed endpoint cache populated but page returns 404 uses the original URL
rspec ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:319 # FetchLinkCardService with a local status with a URL of a page with oEmbed support when oEmbed endpoint cache populated but page returns 404 creates preview card
rspec ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:315 # FetchLinkCardService with a local status with a URL of a page with oEmbed support when oEmbed endpoint cache populated but page returns 404 uses the cached oEmbed response
rspec ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:304 # FetchLinkCardService with a local status with a URL of a page with oEmbed support when oEmbed endpoint cache populated creates preview card
rspec ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:299 # FetchLinkCardService with a local status with a URL of a page with oEmbed support when oEmbed endpoint cache populated uses the cached oEmbed response
rspec ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:90 # FetchLinkCardService with a local status with URL of a regular HTML page creates preview card
rspec ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:165 # FetchLinkCardService with a local status with a page that has no title does not create a preview card
rspec ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:249 # FetchLinkCardService with a local status with a Japanese path URL fetches the URL
rspec ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:129 # FetchLinkCardService with a local status with a redirect URL follows redirect
rspec ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:134 # FetchLinkCardService with a local status with a redirect URL creates preview card
rspec ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:197 # FetchLinkCardService with a local status with a URL of a page in Shift JIS encoding labeled as UTF-8 decodes the HTML despite the wrong charset header
rspec ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:213 # FetchLinkCardService with a local status with a URL of a page in Windows-1251 encoding decodes the HTML
rspec ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:205 # FetchLinkCardService with a local status with a URL of a page in KOI8-R encoding decodes the HTML
rspec ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:109 # FetchLinkCardService with a local status with a URL of a plain-text page does not create a preview card
rspec ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:239 # FetchLinkCardService with a local status with a URL of a page in ISO-8859-1 encoding, that charlock_holmes cannot detect when encoding in http header is incorrect when encoding problems appear in title tag does not create a preview card
rspec ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:231 # FetchLinkCardService with a local status with a URL of a page in ISO-8859-1 encoding, that charlock_holmes cannot detect when encoding in http header is incorrect when encoding problems appear in unrelated tags decodes the HTML
rspec ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:222 # FetchLinkCardService with a local status with a URL of a page in ISO-8859-1 encoding, that charlock_holmes cannot detect when encoding in http header is correct decodes the HTML
rspec ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:333 # FetchLinkCardService with a local status with a URL of a page that includes a canonical URL too long for PostgreSQL unique indexes does not create a preview card
rspec ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:149 # FetchLinkCardService with a local status with a broken redirect URL does not create a preview card
rspec ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:144 # FetchLinkCardService with a local status with a broken redirect URL follows redirect
rspec ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:173 # FetchLinkCardService with a local status with a 404 URL does not create a preview card
rspec ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:341 # FetchLinkCardService with a local status with a URL where the `Content-Type` header uses `utf8` instead of `utf-8` creates a preview card
rspec ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:117 # FetchLinkCardService with a local status with multiple URLs fetches the first valid URL
rspec ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:121 # FetchLinkCardService with a local status with multiple URLs does not fetch the second valid URL
rspec ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:189 # FetchLinkCardService with a local status with a URL of a page in Shift JIS encoding decodes the HTML
rspec ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:181 # FetchLinkCardService with a local status with an IDN URL fetches the URL
rspec ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:265 # FetchLinkCardService with a local status with a caret-suffixed URL fetches the URL
rspec ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:269 # FetchLinkCardService with a local status with a caret-suffixed URL does not strip the caret before fetching
rspec ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:361 # FetchLinkCardService with a remote status ignores URLs to hashtags
rspec ./spec/services/fetch_link_card_service_ai_suggest_3_spec.rb:357 # FetchLinkCardService with a remote status parses out URLs

Randomized with seed 17675
[TEST PROF INFO] Factories usage

 Total: 27
 Total top-level: 27
 Total time: 00:02.356 (out of 00:11.297)
 Total uniq factories: 2

   name                    total   top-level     total time      time per call      top-level time

   status                     26          26        2.2292s            0.0857s             2.2292s
   account                     1           1        0.1276s            0.1276s             0.1276s
github-actions[bot] commented 2 months ago

🤖 Thought: The tests are still failing due to WebMock errors. It seems that the stubbed requests are not matching the actual requests made by the service. We need to update our stub_request calls to be more flexible and match any request to the specified domains.

Here are the results of running an updated version:

[TEST PROF INFO] FactoryProf enabled (simple mode)
[TEST PROF INFO] RSpecDissect enabled

Run options: exclude {:streaming=>true, :search=>true, :js=>true}

Randomized with seed 50446

Progress: |=

  1) FetchLinkCardService with a remote status ignores URLs to hashtags
     Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

     WebMock::NetConnectNotAllowedError:
       Real HTTP connections are disabled. Unregistered request: GET http://example.com/not-found with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:43:56 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

       You can stub this request with the following snippet:

       stub_request(:get, "http://example.com/not-found").
         with(
           headers: {
          'Accept'=>'text/html',
          'Accept-Encoding'=>'gzip',
          'Connection'=>'close',
          'Date'=>'Mon, 19 Aug 2024 12:43:56 GMT',
          'Host'=>'example.com',
          'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
           }).
         to_return(status: 200, body: "", headers: {})

       ============================================================
     # ./app/lib/request.rb:108:in `perform'
     # ./app/services/fetch_link_card_service.rb:48:in `html'
     # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
     # ./app/services/fetch_link_card_service.rb:42:in `process_url'
     # ./app/services/fetch_link_card_service.rb:28:in `block in call'
     # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
     # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
     # ./app/lib/redis_configuration.rb:10:in `with'
     # ./app/models/concerns/redisable.rb:9:in `with_redis'
     # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
     # ./app/services/fetch_link_card_service.rb:26:in `call'
     # ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:36:in `block (2 levels) in <top (required)>'
     # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |===

  2) FetchLinkCardService with a local status with URL of a regular HTML page creates preview card
     Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

     WebMock::NetConnectNotAllowedError:
       Real HTTP connections are disabled. Unregistered request: GET http://example.com/html with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:43:57 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

       You can stub this request with the following snippet:

       stub_request(:get, "http://example.com/html").
         with(
           headers: {
          'Accept'=>'text/html',
          'Accept-Encoding'=>'gzip',
          'Connection'=>'close',
          'Date'=>'Mon, 19 Aug 2024 12:43:57 GMT',
          'Host'=>'example.com',
          'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
           }).
         to_return(status: 200, body: "", headers: {})

       ============================================================
     # ./app/lib/request.rb:108:in `perform'
     # ./app/services/fetch_link_card_service.rb:48:in `html'
     # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
     # ./app/services/fetch_link_card_service.rb:42:in `process_url'
     # ./app/services/fetch_link_card_service.rb:28:in `block in call'
     # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
     # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
     # ./app/lib/redis_configuration.rb:10:in `with'
     # ./app/models/concerns/redisable.rb:9:in `with_redis'
     # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
     # ./app/services/fetch_link_card_service.rb:26:in `call'
     # ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:36:in `block (2 levels) in <top (required)>'
     # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |=====

  3) FetchLinkCardService with a local status with a URL of a plain-text page does not create a preview card
     Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

     WebMock::NetConnectNotAllowedError:
       Real HTTP connections are disabled. Unregistered request: GET http://example.com/text with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:43:57 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

       You can stub this request with the following snippet:

       stub_request(:get, "http://example.com/text").
         with(
           headers: {
          'Accept'=>'text/html',
          'Accept-Encoding'=>'gzip',
          'Connection'=>'close',
          'Date'=>'Mon, 19 Aug 2024 12:43:57 GMT',
          'Host'=>'example.com',
          'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
           }).
         to_return(status: 200, body: "", headers: {})

       ============================================================
     # ./app/lib/request.rb:108:in `perform'
     # ./app/services/fetch_link_card_service.rb:48:in `html'
     # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
     # ./app/services/fetch_link_card_service.rb:42:in `process_url'
     # ./app/services/fetch_link_card_service.rb:28:in `block in call'
     # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
     # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
     # ./app/lib/redis_configuration.rb:10:in `with'
     # ./app/models/concerns/redisable.rb:9:in `with_redis'
     # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
     # ./app/services/fetch_link_card_service.rb:26:in `call'
     # ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:36:in `block (2 levels) in <top (required)>'
     # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |=======

  4) FetchLinkCardService with a local status with a URL of a page in ISO-8859-1 encoding, that charlock_holmes cannot detect when encoding in http header is correct decodes the HTML
     Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

     WebMock::NetConnectNotAllowedError:
       Real HTTP connections are disabled. Unregistered request: GET http://example.com/low_confidence_latin1 with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:43:57 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

       You can stub this request with the following snippet:

       stub_request(:get, "http://example.com/low_confidence_latin1").
         with(
           headers: {
          'Accept'=>'text/html',
          'Accept-Encoding'=>'gzip',
          'Connection'=>'close',
          'Date'=>'Mon, 19 Aug 2024 12:43:57 GMT',
          'Host'=>'example.com',
          'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
           }).
         to_return(status: 200, body: "", headers: {})

       ============================================================
     # ./app/lib/request.rb:108:in `perform'
     # ./app/services/fetch_link_card_service.rb:48:in `html'
     # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
     # ./app/services/fetch_link_card_service.rb:42:in `process_url'
     # ./app/services/fetch_link_card_service.rb:28:in `block in call'
     # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
     # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
     # ./app/lib/redis_configuration.rb:10:in `with'
     # ./app/models/concerns/redisable.rb:9:in `with_redis'
     # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
     # ./app/services/fetch_link_card_service.rb:26:in `call'
     # ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:36:in `block (2 levels) in <top (required)>'
     # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |========

  5) FetchLinkCardService with a local status with a URL of a page in ISO-8859-1 encoding, that charlock_holmes cannot detect when encoding in http header is incorrect when encoding problems appear in title tag does not create a preview card
     Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

     WebMock::NetConnectNotAllowedError:
       Real HTTP connections are disabled. Unregistered request: GET http://example.com/latin1_posing_as_utf8_broken with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:43:57 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

       You can stub this request with the following snippet:

       stub_request(:get, "http://example.com/latin1_posing_as_utf8_broken").
         with(
           headers: {
          'Accept'=>'text/html',
          'Accept-Encoding'=>'gzip',
          'Connection'=>'close',
          'Date'=>'Mon, 19 Aug 2024 12:43:57 GMT',
          'Host'=>'example.com',
          'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
           }).
         to_return(status: 200, body: "", headers: {})

       ============================================================
     # ./app/lib/request.rb:108:in `perform'
     # ./app/services/fetch_link_card_service.rb:48:in `html'
     # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
     # ./app/services/fetch_link_card_service.rb:42:in `process_url'
     # ./app/services/fetch_link_card_service.rb:28:in `block in call'
     # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
     # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
     # ./app/lib/redis_configuration.rb:10:in `with'
     # ./app/models/concerns/redisable.rb:9:in `with_redis'
     # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
     # ./app/services/fetch_link_card_service.rb:26:in `call'
     # ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:36:in `block (2 levels) in <top (required)>'
     # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |==========

  6) FetchLinkCardService with a local status with a URL of a page in ISO-8859-1 encoding, that charlock_holmes cannot detect when encoding in http header is incorrect when encoding problems appear in unrelated tags decodes the HTML
     Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

     WebMock::NetConnectNotAllowedError:
       Real HTTP connections are disabled. Unregistered request: GET http://example.com/latin1_posing_as_utf8_recoverable with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:43:57 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

       You can stub this request with the following snippet:

       stub_request(:get, "http://example.com/latin1_posing_as_utf8_recoverable").
         with(
           headers: {
          'Accept'=>'text/html',
          'Accept-Encoding'=>'gzip',
          'Connection'=>'close',
          'Date'=>'Mon, 19 Aug 2024 12:43:57 GMT',
          'Host'=>'example.com',
          'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
           }).
         to_return(status: 200, body: "", headers: {})

       ============================================================
     # ./app/lib/request.rb:108:in `perform'
     # ./app/services/fetch_link_card_service.rb:48:in `html'
     # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
     # ./app/services/fetch_link_card_service.rb:42:in `process_url'
     # ./app/services/fetch_link_card_service.rb:28:in `block in call'
     # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
     # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
     # ./app/lib/redis_configuration.rb:10:in `with'
     # ./app/models/concerns/redisable.rb:9:in `with_redis'
     # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
     # ./app/services/fetch_link_card_service.rb:26:in `call'
     # ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:36:in `block (2 levels) in <top (required)>'
     # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |============

  7) FetchLinkCardService with a local status with a URL of a page in Windows-1251 encoding decodes the HTML
     Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

     WebMock::NetConnectNotAllowedError:
       Real HTTP connections are disabled. Unregistered request: GET http://example.com/windows-1251 with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:43:58 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

       You can stub this request with the following snippet:

       stub_request(:get, "http://example.com/windows-1251").
         with(
           headers: {
          'Accept'=>'text/html',
          'Accept-Encoding'=>'gzip',
          'Connection'=>'close',
          'Date'=>'Mon, 19 Aug 2024 12:43:58 GMT',
          'Host'=>'example.com',
          'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
           }).
         to_return(status: 200, body: "", headers: {})

       ============================================================
     # ./app/lib/request.rb:108:in `perform'
     # ./app/services/fetch_link_card_service.rb:48:in `html'
     # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
     # ./app/services/fetch_link_card_service.rb:42:in `process_url'
     # ./app/services/fetch_link_card_service.rb:28:in `block in call'
     # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
     # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
     # ./app/lib/redis_configuration.rb:10:in `with'
     # ./app/models/concerns/redisable.rb:9:in `with_redis'
     # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
     # ./app/services/fetch_link_card_service.rb:26:in `call'
     # ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:36:in `block (2 levels) in <top (required)>'
     # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |==============

  8) FetchLinkCardService with a local status with a broken redirect URL does not create a preview card
     Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

     WebMock::NetConnectNotAllowedError:
       Real HTTP connections are disabled. Unregistered request: GET http://example.com/redirect-to-404 with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:43:58 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

       You can stub this request with the following snippet:

       stub_request(:get, "http://example.com/redirect-to-404").
         with(
           headers: {
          'Accept'=>'text/html',
          'Accept-Encoding'=>'gzip',
          'Connection'=>'close',
          'Date'=>'Mon, 19 Aug 2024 12:43:58 GMT',
          'Host'=>'example.com',
          'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
           }).
         to_return(status: 200, body: "", headers: {})

       ============================================================
     # ./app/lib/request.rb:108:in `perform'
     # ./app/services/fetch_link_card_service.rb:48:in `html'
     # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
     # ./app/services/fetch_link_card_service.rb:42:in `process_url'
     # ./app/services/fetch_link_card_service.rb:28:in `block in call'
     # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
     # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
     # ./app/lib/redis_configuration.rb:10:in `with'
     # ./app/models/concerns/redisable.rb:9:in `with_redis'
     # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
     # ./app/services/fetch_link_card_service.rb:26:in `call'
     # ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:36:in `block (2 levels) in <top (required)>'
     # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |=================

  9) FetchLinkCardService with a local status with a broken redirect URL follows redirect
     Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

     WebMock::NetConnectNotAllowedError:
       Real HTTP connections are disabled. Unregistered request: GET http://example.com/redirect-to-404 with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:43:58 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

       You can stub this request with the following snippet:

       stub_request(:get, "http://example.com/redirect-to-404").
         with(
           headers: {
          'Accept'=>'text/html',
          'Accept-Encoding'=>'gzip',
          'Connection'=>'close',
          'Date'=>'Mon, 19 Aug 2024 12:43:58 GMT',
          'Host'=>'example.com',
          'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
           }).
         to_return(status: 200, body: "", headers: {})

       ============================================================
     # ./app/lib/request.rb:108:in `perform'
     # ./app/services/fetch_link_card_service.rb:48:in `html'
     # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
     # ./app/services/fetch_link_card_service.rb:42:in `process_url'
     # ./app/services/fetch_link_card_service.rb:28:in `block in call'
     # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
     # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
     # ./app/lib/redis_configuration.rb:10:in `with'
     # ./app/models/concerns/redisable.rb:9:in `with_redis'
     # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
     # ./app/services/fetch_link_card_service.rb:26:in `call'
     # ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:36:in `block (2 levels) in <top (required)>'
     # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |==================

  10) FetchLinkCardService with a local status with a URL where the `Content-Type` header uses `utf8` instead of `utf-8` creates a preview card
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/alternative_utf8_spelling_in_header with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:43:58 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/alternative_utf8_spelling_in_header").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:43:58 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:36:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |====================

  11) FetchLinkCardService with a local status with a redirect URL creates preview card
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/redirect with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:43:58 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/redirect").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:43:58 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:36:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |======================

  12) FetchLinkCardService with a local status with a redirect URL follows redirect
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/redirect with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:43:58 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/redirect").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:43:58 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:36:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |========================

  13) FetchLinkCardService with a local status with URL of a page with no title does not create a preview card
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/html with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:43:58 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/html").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:43:58 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:36:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |=========================

  14) FetchLinkCardService with a local status with a Japanese path URL fetches the URL
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/%E6%97%A5%E6%9C%AC%E8%AA%9E with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:43:58 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/%E6%97%A5%E6%9C%AC%E8%AA%9E").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:43:58 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:36:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |===========================

  15) FetchLinkCardService with a local status with a redirect URL with faulty encoding does not create a preview card
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/aergerliche-umlaute with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:43:58 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/aergerliche-umlaute").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:43:58 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:36:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |===============================

  16) FetchLinkCardService with a local status with a URL of a page with oEmbed support creates preview card
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/html with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:43:58 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/html").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:43:58 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:36:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |==================================

  17) FetchLinkCardService with a local status with a URL of a page with oEmbed support fetches the oEmbed URL
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/html with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:43:58 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/html").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:43:58 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:36:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |===================================

  18) FetchLinkCardService with a local status with a URL of a page with oEmbed support when oEmbed endpoint cache populated but page returns 404 creates preview card
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/oembed?url=http://example.com/html with headers {'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:43:59 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/)'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/oembed?url=http://example.com/html").
          with(
            headers: {
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:43:59 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/)'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_oembed_service.rb:84:in `fetch!'
      # ./app/services/fetch_oembed_service.rb:19:in `call'
      # ./app/services/fetch_link_card_service.rb:107:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:36:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |=====================================

  19) FetchLinkCardService with a local status with a URL of a page with oEmbed support when oEmbed endpoint cache populated but page returns 404 uses the original URL
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/oembed?url=http://example.com/html with headers {'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:43:59 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/)'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/oembed?url=http://example.com/html").
          with(
            headers: {
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:43:59 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/)'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_oembed_service.rb:84:in `fetch!'
      # ./app/services/fetch_oembed_service.rb:19:in `call'
      # ./app/services/fetch_link_card_service.rb:107:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:36:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |=======================================

  20) FetchLinkCardService with a local status with a URL of a page with oEmbed support when oEmbed endpoint cache populated but page returns 404 uses the cached oEmbed response
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/oembed?url=http://example.com/html with headers {'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:43:59 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/)'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/oembed?url=http://example.com/html").
          with(
            headers: {
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:43:59 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/)'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_oembed_service.rb:84:in `fetch!'
      # ./app/services/fetch_oembed_service.rb:19:in `call'
      # ./app/services/fetch_link_card_service.rb:107:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:36:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |=========================================

  21) FetchLinkCardService with a local status with a URL of a page with oEmbed support when oEmbed endpoint cache populated creates preview card
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/oembed?format=json&url=http://example.com/html with headers {'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:43:59 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/)'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/oembed?format=json&url=http://example.com/html").
          with(
            headers: {
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:43:59 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/)'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_oembed_service.rb:84:in `fetch!'
      # ./app/services/fetch_oembed_service.rb:19:in `call'
      # ./app/services/fetch_link_card_service.rb:107:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:36:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |==========================================

  22) FetchLinkCardService with a local status with a URL of a page with oEmbed support when oEmbed endpoint cache populated uses the cached oEmbed response
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/oembed?format=json&url=http://example.com/html with headers {'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:43:59 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/)'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/oembed?format=json&url=http://example.com/html").
          with(
            headers: {
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:43:59 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/)'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_oembed_service.rb:84:in `fetch!'
      # ./app/services/fetch_oembed_service.rb:19:in `call'
      # ./app/services/fetch_link_card_service.rb:107:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:36:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |============================================

  23) FetchLinkCardService with a local status with a caret-suffixed URL fetches the URL
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/test?data=file.gpx%5E1 with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:43:59 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/test?data=file.gpx%5E1").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:43:59 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:36:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |==============================================

  24) FetchLinkCardService with a local status with a caret-suffixed URL does not strip the caret before fetching
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/test?data=file.gpx%5E1 with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:43:59 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/test?data=file.gpx%5E1").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:43:59 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:36:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |================================================

  25) FetchLinkCardService with a local status with a URL of a page in KOI8-R encoding decodes the HTML
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/koi8-r with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:43:59 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/koi8-r").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:43:59 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:36:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |===================================================

  26) FetchLinkCardService with a local status with a URL of a page in Shift JIS encoding labeled as UTF-8 decodes the HTML despite the wrong charset header
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/sjis_with_wrong_charset with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:43:59 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/sjis_with_wrong_charset").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:43:59 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:36:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |====================================================

  27) FetchLinkCardService with a local status with a page that has no title does not create a preview card
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/page_without_title with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:43:59 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/page_without_title").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:43:59 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:36:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |======================================================

  28) FetchLinkCardService with a local status with an IDN URL fetches the URL
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.xn--fiqs8s/ with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:43:59 GMT', 'Host'=>'example.xn--fiqs8s', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.xn--fiqs8s/").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:43:59 GMT',
              'Host'=>'example.xn--fiqs8s',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:36:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |========================================================

  29) FetchLinkCardService with a local status with a URL of a page in Shift JIS encoding decodes the HTML
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/sjis with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:43:59 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/sjis").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:43:59 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:36:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |==========================================================

  30) FetchLinkCardService with a local status with a hyphen-suffixed URL fetches the URL
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/test- with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:43:59 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/test-").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:43:59 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:36:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |===========================================================

  31) FetchLinkCardService with a local status with multiple URLs does not fetch the second valid URL
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/html with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:43:59 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/html").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:43:59 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:36:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |=============================================================

  32) FetchLinkCardService with a local status with multiple URLs fetches the first valid URL
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/html with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:44:00 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/html").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:44:00 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:36:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |===============================================================

  33) FetchLinkCardService with a local status with a 404 URL does not create a preview card
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/not-found with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:44:00 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/not-found").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:44:00 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:36:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |=================================================================

  34) FetchLinkCardService with a local status with a URL of a page that includes a canonical URL too long for PostgreSQL unique indexes does not create a preview card
      Failure/Error: response = http_client.request(@verb, @url.to_s, @options.merge(headers: headers))

      WebMock::NetConnectNotAllowedError:
        Real HTTP connections are disabled. Unregistered request: GET http://example.com/long_canonical_url with headers {'Accept'=>'text/html', 'Accept-Encoding'=>'gzip', 'Connection'=>'close', 'Date'=>'Mon, 19 Aug 2024 12:44:00 GMT', 'Host'=>'example.com', 'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'}

        You can stub this request with the following snippet:

        stub_request(:get, "http://example.com/long_canonical_url").
          with(
            headers: {
              'Accept'=>'text/html',
              'Accept-Encoding'=>'gzip',
              'Connection'=>'close',
              'Date'=>'Mon, 19 Aug 2024 12:44:00 GMT',
              'Host'=>'example.com',
              'User-Agent'=>'http.rb/5.2.0 (Mastodon/4.3.0-alpha.5; +https://cb6e6126.ngrok.io/) Bot'
            }).
          to_return(status: 200, body: "", headers: {})

        ============================================================
      # ./app/lib/request.rb:108:in `perform'
      # ./app/services/fetch_link_card_service.rb:48:in `html'
      # ./app/services/fetch_link_card_service.rb:108:in `attempt_oembed'
      # ./app/services/fetch_link_card_service.rb:42:in `process_url'
      # ./app/services/fetch_link_card_service.rb:28:in `block in call'
      # ./app/models/concerns/lockable.rb:12:in `block (2 levels) in with_redis_lock'
      # ./app/models/concerns/lockable.rb:10:in `block in with_redis_lock'
      # ./app/lib/redis_configuration.rb:10:in `with'
      # ./app/models/concerns/redisable.rb:9:in `with_redis'
      # ./app/models/concerns/lockable.rb:9:in `with_redis_lock'
      # ./app/services/fetch_link_card_service.rb:26:in `call'
      # ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:36:in `block (2 levels) in <top (required)>'
      # ./spec/rails_helper.rb:132:in `block (2 levels) in <top (required)>'

Progress: |====================================================================|
[TEST PROF INFO] RSpecDissect report

Total time: 00:01.073

Total `let` time: 00:00.130
Total `before(:each)` time: 00:00.207

Top 5 slowest suites (by `let` time):

FetchLinkCardService (./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:5) – 00:00.130 of 00:01.073 (36)
 ↳ oembed_cache – 41
 ↳ subject – 36
 ↳ status – 36

Top 5 slowest suites (by `before(:each)` time):

FetchLinkCardService (./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:5) – 00:00.207 of 00:01.073 (36)

Finished in 5.06 seconds (files took 10.93 seconds to load)
36 examples, 34 failures

Failed examples:

rspec ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:314 # FetchLinkCardService with a remote status ignores URLs to hashtags
rspec ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:43 # FetchLinkCardService with a local status with URL of a regular HTML page creates preview card
rspec ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:62 # FetchLinkCardService with a local status with a URL of a plain-text page does not create a preview card
rspec ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:175 # FetchLinkCardService with a local status with a URL of a page in ISO-8859-1 encoding, that charlock_holmes cannot detect when encoding in http header is correct decodes the HTML
rspec ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:192 # FetchLinkCardService with a local status with a URL of a page in ISO-8859-1 encoding, that charlock_holmes cannot detect when encoding in http header is incorrect when encoding problems appear in title tag does not create a preview card
rspec ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:184 # FetchLinkCardService with a local status with a URL of a page in ISO-8859-1 encoding, that charlock_holmes cannot detect when encoding in http header is incorrect when encoding problems appear in unrelated tags decodes the HTML
rspec ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:166 # FetchLinkCardService with a local status with a URL of a page in Windows-1251 encoding decodes the HTML
rspec ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:102 # FetchLinkCardService with a local status with a broken redirect URL does not create a preview card
rspec ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:97 # FetchLinkCardService with a local status with a broken redirect URL follows redirect
rspec ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:294 # FetchLinkCardService with a local status with a URL where the `Content-Type` header uses `utf8` instead of `utf-8` creates a preview card
rspec ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:87 # FetchLinkCardService with a local status with a redirect URL creates preview card
rspec ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:82 # FetchLinkCardService with a local status with a redirect URL follows redirect
rspec ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:54 # FetchLinkCardService with a local status with URL of a page with no title does not create a preview card
rspec ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:202 # FetchLinkCardService with a local status with a Japanese path URL fetches the URL
rspec ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:110 # FetchLinkCardService with a local status with a redirect URL with faulty encoding does not create a preview card
rspec ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:243 # FetchLinkCardService with a local status with a URL of a page with oEmbed support creates preview card
rspec ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:239 # FetchLinkCardService with a local status with a URL of a page with oEmbed support fetches the oEmbed URL
rspec ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:272 # FetchLinkCardService with a local status with a URL of a page with oEmbed support when oEmbed endpoint cache populated but page returns 404 creates preview card
rspec ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:277 # FetchLinkCardService with a local status with a URL of a page with oEmbed support when oEmbed endpoint cache populated but page returns 404 uses the original URL
rspec ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:268 # FetchLinkCardService with a local status with a URL of a page with oEmbed support when oEmbed endpoint cache populated but page returns 404 uses the cached oEmbed response
rspec ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:257 # FetchLinkCardService with a local status with a URL of a page with oEmbed support when oEmbed endpoint cache populated creates preview card
rspec ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:252 # FetchLinkCardService with a local status with a URL of a page with oEmbed support when oEmbed endpoint cache populated uses the cached oEmbed response
rspec ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:218 # FetchLinkCardService with a local status with a caret-suffixed URL fetches the URL
rspec ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:222 # FetchLinkCardService with a local status with a caret-suffixed URL does not strip the caret before fetching
rspec ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:158 # FetchLinkCardService with a local status with a URL of a page in KOI8-R encoding decodes the HTML
rspec ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:150 # FetchLinkCardService with a local status with a URL of a page in Shift JIS encoding labeled as UTF-8 decodes the HTML despite the wrong charset header
rspec ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:118 # FetchLinkCardService with a local status with a page that has no title does not create a preview card
rspec ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:134 # FetchLinkCardService with a local status with an IDN URL fetches the URL
rspec ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:142 # FetchLinkCardService with a local status with a URL of a page in Shift JIS encoding decodes the HTML
rspec ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:210 # FetchLinkCardService with a local status with a hyphen-suffixed URL fetches the URL
rspec ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:74 # FetchLinkCardService with a local status with multiple URLs does not fetch the second valid URL
rspec ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:70 # FetchLinkCardService with a local status with multiple URLs fetches the first valid URL
rspec ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:126 # FetchLinkCardService with a local status with a 404 URL does not create a preview card
rspec ./spec/services/fetch_link_card_service_ai_suggest_4_spec.rb:286 # FetchLinkCardService with a local status with a URL of a page that includes a canonical URL too long for PostgreSQL unique indexes does not create a preview card

Randomized with seed 50446
[TEST PROF INFO] Factories usage

 Total: 27
 Total top-level: 27
 Total time: 00:02.631 (out of 00:12.073)
 Total uniq factories: 2

   name                    total   top-level     total time      time per call      top-level time

   status                     26          26        2.1487s            0.0826s             2.1487s
   account                     1           1        0.4829s            0.4829s             0.4829s
github-actions[bot] commented 2 months ago

🤖 Reached the max number of refactoring runs (4). Stopping here.