Sha256: 18519fb2e11a330ecdd1ed7ee86e7441860485afdef2c50519a54170b5d779fc

Contents?: true

Size: 806 Bytes

Versions: 1

Compression:

Stored size: 806 Bytes

Contents

require "test_helper"
require "browser/rails"
require "sample_app"

class MiddlewareTest < Test::Unit::TestCase
  include Rack::Test::Methods

  def app
    Rails.application
  end

  def test_redirect_uses_302
    get "/", {}, {"HTTP_USER_AGENT" => "MSIE 6"}
    assert_equal 302, last_response.status
  end

  def test_redirect_ie6_to_upgrade_path
    get "/", {}, {"HTTP_USER_AGENT" => "MSIE 6"}
    follow_redirect!

    assert_equal "UPGRADE: ie6", last_response.body
  end

  def test_redirect_ie7_to_upgrade_path
    get "/", {}, {"HTTP_USER_AGENT" => "MSIE 7"}
    follow_redirect!

    assert_equal "UPGRADE: ie7", last_response.body
  end

  def test_redirect_ie8_and_404
    get "/", {}, {"HTTP_USER_AGENT" => "MSIE 8"}
    follow_redirect!

    assert_equal 404, last_response.status
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
browser-0.3.0 test/middleware_test.rb