Skip to content

Commit

Permalink
Merge pull request #21677 from ronakjangir47/send_file_headers_test
Browse files Browse the repository at this point in the history
Added test for `send_file_headers` called with nil content type
  • Loading branch information
jeremy committed Sep 19, 2015
2 parents 377a9c3 + efa019b commit a6f461c
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion actionpack/test/controller/send_file_test.rb
Expand Up @@ -143,7 +143,18 @@ def test_send_file_headers_with_bad_symbol
}

@controller.headers = {}
assert_raise(ArgumentError) { @controller.send(:send_file_headers!, options) }
error = assert_raise(ArgumentError) { @controller.send(:send_file_headers!, options) }
assert_equal "Unknown MIME type #{options[:type]}", error.message
end

def test_send_file_headers_with_nil_content_type
options = {
:type => nil
}

@controller.headers = {}
error = assert_raise(ArgumentError) { @controller.send(:send_file_headers!, options) }
assert_equal ":type option required", error.message
end

def test_send_file_headers_guess_type_from_extension
Expand Down

0 comments on commit a6f461c

Please sign in to comment.