vendor/plugins/form_test_helper/lib/form_test_helper.rb
# If you submit the form with JavaScript
If you submit the form with JavaScript
If you submit the form with JavaScript
def submit_without_clicking_button
      path = self.action.blank? ? self.uri : self.action 
      params = {}
      fields.each {|field| params[field.name] = field.value unless field.value.nil? || field.value == [] || params[field.name] } 
      params = ActionController::UrlEncodedPairParser.new(params).result
      @testcase.make_request(request_method, path, params, self.uri, @xhr)
    end
def submit_without_clicking_button path = self . action . blank? ? self . uri : self . action params = { } fields . each { | field | params [ field . name ] = field . value unless field . value . nil? || field . value == [ ] || params [ field . name ] } params = ActionController :: UrlEncodedPairParser . new ( params ) . result @testcase . make_request ( request_method , path , params , self . uri , @xhr ) end
If you submit the form with JavaScript
If you submit the form with JavaScript
# If no action attribute on form, it submits to the same URI where the form was displayed # don't submit the nils, empty arrays, and fields already named # Convert arrays and hashes in param keys, since test processing doesn't do this automatically