Sha256: 2f371aff3745601b6f8b2bc33edd13f643bda110ab7abe68e4a9616057009a41

Contents?: true

Size: 1.47 KB

Versions: 3

Compression:

Stored size: 1.47 KB

Contents

require 'helper'

class WebTest < Test::Unit::TestCase
  
  get '/' do
    should_respond_with 404
    should("render an empty string") { assert_equal '', last_response.body }
  end
  
  get '/SampleFont.css' do
    should_respond_with 200
    should_set_header 'Content-Type', 'text/css;charset=utf-8'
    should_set_caching
    should_have_rendered_css 'SampleFont'
  end
  
  get '/CustomCSS.css' do
    should_respond_with 200
    should_set_header 'Content-Type', 'text/css;charset=utf-8'
    should_set_caching
    should_have_rendered_css 'CustomCSS'
  end
  
  get '/LicenseFont.css' do
    should_respond_with 200
    should_set_header 'Content-Type', 'text/css;charset=utf-8'
    should_set_caching
    should_have_rendered_css 'LicenseFont'
  end

  %w(eot otf svg ttf woff).each do |format|
    get "/SampleFont.#{format}" do
      should_respond_with 200
      should_set_content_type_for format
      should_set_caching
    end
  end  
  
  %w(otf svg ttf woff).each do |format|
    get "/AnotherFont.#{format}" do
      should_respond_with 200
      should_set_content_type_for format
      should_set_caching
    end
  end
  
  get '/AnotherFont.eot' do
    should_respond_with 404
    should_not_set_caching
  end
  
  %w(eot otf svg woff).each do |format|
    get "/SimpleFont.#{format}" do
      should_respond_with 404
      should_not_set_caching
    end
  end
  
  get '/demo' do
    should_respond_with 200
    should_set_header 'Content-Type', 'text/html;charset=utf-8'
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rack-fontserve-0.1.2 test/test_web.rb
rack-fontserve-0.1.1 test/test_web.rb
rack-fontserve-0.1.0 test/test_web.rb