Sha256: cc5e7bcbba2ef0a4bd74b8968fdddc4b1f12de9196c441274683c413c6e0238a

Contents?: true

Size: 653 Bytes

Versions: 11

Compression:

Stored size: 653 Bytes

Contents

beforeEach ->

  jasmine.Ajax.addCustomParamParser
    test: (xhr) ->
      up.util.isFormData(xhr.params)

    parse: (params) ->
      if up.browser.canInspectFormData()
        array = new up.Params(params).toArray()
      else if params.originalArray
        # In browser that don't support FormData#entries(),
        # up.Params#toArray() stores the original array with the generated
        # FormData object.
        array = params.originalArray
      else
        throw "Cannot parse FormData for inspection in tests"

      obj = {}

      for entry in array
        obj[entry.name] ||= []
        obj[entry.name].push(entry.value)

      obj

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
unpoly-rails-1.0.3 spec_app/spec/javascripts/helpers/parse_form_data.js.coffee
unpoly-rails-1.0.1 spec_app/spec/javascripts/helpers/parse_form_data.js.coffee
unpoly-rails-1.0.0 spec_app/spec/javascripts/helpers/parse_form_data.js.coffee
unpoly-rails-0.62.1 spec_app/spec/javascripts/helpers/parse_form_data.js.coffee
unpoly-rails-0.62.0 spec_app/spec/javascripts/helpers/parse_form_data.js.coffee
unpoly-rails-0.61.1 spec_app/spec/javascripts/helpers/parse_form_data.js.coffee
unpoly-rails-0.61.0 spec_app/spec/javascripts/helpers/parse_form_data.js.coffee
unpoly-rails-0.60.3 spec_app/spec/javascripts/helpers/parse_form_data.js.coffee
unpoly-rails-0.60.2 spec_app/spec/javascripts/helpers/parse_form_data.js.coffee
unpoly-rails-0.60.1 spec_app/spec/javascripts/helpers/parse_form_data.js.coffee
unpoly-rails-0.60.0 spec_app/spec/javascripts/helpers/parse_form_data.js.coffee