Sha256: 7b3097465c47bcf130de529d6c0c8f3831f813d494001f5bc17652bdae158f57

Contents?: true

Size: 578 Bytes

Versions: 9

Compression:

Stored size: 578 Bytes

Contents

require 'abstract_unit'

module ContentType
  class ImpliedController < ActionController::Base
    # Template's mime type is used if no content_type is specified

    self.view_paths = [ActionView::FixtureResolver.new(
      "content_type/implied/i_am_js_rjs.js.rjs" => "page.alert 'hello'"
    )]
  end
  
  class ImpliedContentTypeTest < Rack::TestCase
    test "sets Content-Type as text/javascript when rendering *.js" do
      get "/content_type/implied/i_am_js_rjs", "format" => "js"

      assert_header "Content-Type", "text/javascript; charset=utf-8"
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
prototype-rails-4.0.0 test/controller/new_base/content_type_test.rb
prototype-rails-3.2.1 test/controller/new_base/content_type_test.rb
prototype-rails-3.2.0.rc1 test/controller/new_base/content_type_test.rb
prototype-rails-3.2.0 test/controller/new_base/content_type_test.rb
prototype-rails-3.1.0 test/controller/new_base/content_type_test.rb
prototype-rails-0.3.1 test/controller/new_base/content_type_test.rb
prototype-rails-0.3.0 test/controller/new_base/content_type_test.rb
prototype-rails-0.2 test/controller/new_base/content_type_test.rb
prototype-rails-0.1 test/controller/new_base/content_type_test.rb