Sha256: 89731f95c43ee215f67ce0c6b21b49619bc1882e10ebd0f05fc30e92780a08f4

Contents?: true

Size: 521 Bytes

Versions: 3

Compression:

Stored size: 521 Bytes

Contents

# frozen_string_literal: true
require "test_helper"

class HtmlResponseTest < Minitest::Test
  test "detects as html" do
    register_uri(:get, "http://example.org/", body: "", content_type: "text/html")
    response = Aitch.get("http://example.org/")

    assert response.html?
  end

  test "returns html" do
    register_uri(:get, "http://example.org/", body: "Hello", content_type: "text/html")
    response = Aitch.get("http://example.org/")

    assert_instance_of Nokogiri::HTML::Document, response.data
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
aitch-1.0.2 test/aitch/response/html_response_test.rb
aitch-1.0.1 test/aitch/response/html_response_test.rb
aitch-1.0.0 test/aitch/response/html_response_test.rb