[rspec-users] specing send_file

vo.x v.ondruch at gmail.com
Fri Feb 20 17:45:29 EST 2009


Hello everybody!

Im wondering what is the best way of specing action with send file
such as:

  def download
    log = ActivityLog.find(params[:id])
    if log
      send_file log.path
    else
      flash[:notice] = _("Log file \"#{params[:id]}\" was not found.")
      redirect_to :action => 'index'
    end
  end

You can see that the ActivityLog class is not inherited from AR and
the path dependes on specified ID.

Thank you in advance.

Vit


More information about the rspec-users mailing list