Hi all,
 having problems to mock params for the following controller, need help
    def index
    if params[:q].present?
      @q = params[:q]
      @field = params[:field]
      case @field
      when "filenames"
        @attachments = Attachment.where( :file_name => /#{@q}/i )
        @documents = Array.new
        @attachments.each do |a|
          @documents << a.document
        end
        @documents.uniq!
      when "vendor_code", "document_number", "batch_number", "cheque_number"
        @documents = Document.where( @field => @q )
      end
      puts "@documents = #{@documents.inspect}"
    end
  end
 Regards,
 Farheen Zahara





_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to