Sha256: 687d9fdedea7f1b84b05156bbebf2bb3a2cf2f60d7d835dcb80cad6b8c052e10

Contents?: true

Size: 585 Bytes

Versions: 2

Compression:

Stored size: 585 Bytes

Contents

require 'abstract_unit'

class TextTest < ActiveSupport::TestCase
  test 'formats returns symbol for recognized MIME type' do
    assert_equal [:text], ActionView::Template::Text.new('', :text).formats
  end

  test 'formats returns string for recognized MIME type when MIME does not have symbol' do
    foo = Mime::Type.lookup("foo")
    assert_nil foo.to_sym
    assert_equal ['foo'], ActionView::Template::Text.new('', foo).formats
  end

  test 'formats returns string for unknown MIME type' do
    assert_equal ['foo'], ActionView::Template::Text.new('', 'foo').formats
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
activejob-lock-0.0.2 rails/actionview/test/template/text_test.rb
activejob-lock-0.0.1 rails/actionview/test/template/text_test.rb