Topic: How so I spec that an action returns binary data via send_data?

I have something like this:

def show_small_avatar
  send_data(
    @profile.small_avatar,
    :type => @profile.content_type,
    :filename => @profile.filename,
    :disposition => 'inline'
  ) unless @profile.small_avatar.nil?

  send_data(
    File.open( "#{RAILS_ROOT}/public/images/default_small_avatar.gif" ).read,
    :type => "image/gif",
    :filename => "default_small_avatar.gif",
    :disposition => 'inline'
  ) if @profile.small_avatar.nil?
end


And I need to spec and test that it actually returns binary data via the send_data call but since it isn't a template I am not sure how to test it.

Any help would be greatly appreciated!

Re: How so I spec that an action returns binary data via send_data?

I need to know this too smile