diff options
author | José Valim <jose.valim@gmail.com> | 2009-07-29 10:09:21 +0200 |
---|---|---|
committer | Yehuda Katz <wycats@gmail.com> | 2009-07-29 12:06:03 -0700 |
commit | 67b2d08c0a64ddec3a0c4e1c0b5d96bd418cceef (patch) | |
tree | 92528304fc98513b3641ce56d7e134f3631dfbc7 /actionpack/lib/action_controller | |
parent | b51632d34d99ee9cae3287c60887b25fdf7a3618 (diff) | |
download | rails-67b2d08c0a64ddec3a0c4e1c0b5d96bd418cceef.tar.gz rails-67b2d08c0a64ddec3a0c4e1c0b5d96bd418cceef.tar.bz2 rails-67b2d08c0a64ddec3a0c4e1c0b5d96bd418cceef.zip |
Ensure that the proper accept header value is set during tests.
Signed-off-by: Yehuda Katz <wycats@gmail.com>
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r-- | actionpack/lib/action_controller/base/mime_responds.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/base/mime_responds.rb b/actionpack/lib/action_controller/base/mime_responds.rb index dff4d7b943..ece4920a23 100644 --- a/actionpack/lib/action_controller/base/mime_responds.rb +++ b/actionpack/lib/action_controller/base/mime_responds.rb @@ -146,12 +146,12 @@ module ActionController #:nodoc: # # Mime::Type.register "image/jpg", :jpg def respond_to(*mimes, &block) + raise ArgumentError, "respond_to takes either types or a block, never both" if mimes.any? && block_given? responder = Responder.new - block.call(responder) if block_given? mimes = collect_mimes_from_class_level if mimes.empty? - mimes.each { |mime| responder.send(mime) } + mimes.each { |mime| responder.custom(mime) } if format = request.negotiate_mime(responder.order) # TODO It should be just: self.formats = [ :foo ] |