Sha256: a03b5091f1848a88e82a2e877c3089858df3e0a435514a13603dbacf549f914d

Contents?: true

Size: 842 Bytes

Versions: 1

Compression:

Stored size: 842 Bytes

Contents

# frozen_string_literal: true

require "test_helper"

class SubdomainsTest < Minitest::Test
  def app
    App
  end

  test "renders listed subdomain (a)" do
    header "HOST", "a.example.com"
    get "/"

    assert_equal "array: a", last_response.body
  end

  test "renders listed subdomain (b)" do
    header "HOST", "b.example.com"
    get "/"

    assert_equal "array: b", last_response.body
  end

  test "renders matched subdomain (c)" do
    header "HOST", "c.example.com"
    get "/"

    assert_equal "regex: c", last_response.body
  end

  test "renders matched subdomain (d)" do
    header "HOST", "d.example.com"
    get "/"

    assert_equal "regex: d", last_response.body
  end

  test "renders matched subdomain (e)" do
    header "HOST", "e.example.com"
    get "/"

    assert_equal "proc: e", last_response.body
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sinatra-subdomain-0.4.0 test/sinatra-subdomain/subdomains_test.rb