def params
      query_string = []
      replaces = {}

      fields.each do |field|
        next if field.to_query_string.nil?
        replaces.merge!({field.digest_value => field.test_uploaded_file}) if field.is_a?(FileField)
        query_string << field.to_query_string
      end

      query_params = self.class.query_string_to_params(query_string.join('&'))

      query_params = self.class.replace_params_values(query_params, replaces)

      self.class.unescape_params(query_params)
    end
def params
      query_string = []
      replaces = {}

      fields.each do |field|
        next if field.to_query_string.nil?
        replaces.merge!({field.digest_value => field.test_uploaded_file}) if field.is_a?(FileField)
        query_string << field.to_query_string
      end

      query_params = self.class.query_string_to_params(query_string.join('&'))

      query_params = self.class.replace_params_values(query_params, replaces)

      self.class.unescape_params(query_params)
    end
iterate over all form fields to build a request querystring to get params from it,
 for file_field we made a work around to pass a digest as value to later replace it
 in params hash with the real file.