Guest User

Untitled

a guest
Feb 19th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. #
  2. # Macro that creates a test asserting that the controller sends the
  3. # content type given.
  4. # Example:
  5. #
  6. # should_send_content_type :pdf
  7. # should_send_content_type :csv
  8. def should_send_content_type(content_type)
  9. should "send content type #{content_type}" do
  10. assert_equal Mime::Type.lookup_by_extension(content_type.to_s).to_s,
  11. @response.content_type
  12. end
  13. end
Add Comment
Please, Sign In to add comment