aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/application/middleware/best_practices_test.rb
blob: 1c88b9bf067d990cc2376fcfdbf76c7c157ddef2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
require 'isolation/abstract_unit'

module ApplicationTests
  class BestPracticesTest < Test::Unit::TestCase
    include ActiveSupport::Testing::Isolation

    def setup
      build_app
      boot_rails
      require 'rack/test'
      extend Rack::Test::Methods
      simple_controller
    end

    def teardown
      teardown_app
    end

    test "simple controller in production mode returns best standards" do
      get '/foo'
      assert_equal "IE=Edge,chrome=1", last_response.headers["X-UA-Compatible"]
    end

    test "simple controller in development mode leaves out Chrome" do
      app("development")
      get "/foo"
      assert_equal "IE=Edge", last_response.headers["X-UA-Compatible"]
    end
  end
end