Created
September 4, 2008 21:45
-
-
Save hardbap/8884 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Macro that creates a test asserting that the controller sends the | |
# content type given. | |
# Example: | |
# | |
# should_send_content_type :pdf | |
# should_send_content_type :csv | |
def should_send_content_type(content_type) | |
should "send content type #{content_type}" do | |
assert_equal Mime::Type.lookup_by_extension(content_type.to_s).to_s, | |
@response.content_type | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment