Skip to content

Instantly share code, notes, and snippets.

@hardbap
Created September 4, 2008 21:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hardbap/8884 to your computer and use it in GitHub Desktop.
Save hardbap/8884 to your computer and use it in GitHub Desktop.
#
# 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