Sha256: ebf5b70d37ca1af620cab8492a90036c3bb37db917d1608fb76723bfba03b834

Contents?: true

Size: 615 Bytes

Versions: 31

Compression:

Stored size: 615 Bytes

Contents

u = up.util

beforeEach ->
  jasmine.addMatchers
    toHaveRequestMethod: (util, customEqualityTesters) ->
      compare: (request, expectedMethod) ->
        realMethodMatches = (request.method == expectedMethod)
        formData = request.data()
        if u.isFormData(formData)
          wrappedMethod = formData.get('_method')
          wrappedMethodMatches = (wrappedMethod == expectedMethod)
        else
          wrappedMethod = formData['_method']
          wrappedMethodMatches = util.equals(wrappedMethod, [expectedMethod], customEqualityTesters)
        pass: realMethodMatches || wrappedMethodMatches

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
unpoly-rails-0.57.0 spec_app/spec/javascripts/helpers/to_have_request_method.js.coffee
unpoly-rails-0.56.7 spec_app/spec/javascripts/helpers/to_have_request_method.js.coffee
unpoly-rails-0.56.6 spec_app/spec/javascripts/helpers/to_have_request_method.js.coffee
unpoly-rails-0.56.5 spec_app/spec/javascripts/helpers/to_have_request_method.js.coffee
unpoly-rails-0.56.4 spec_app/spec/javascripts/helpers/to_have_request_method.js.coffee
unpoly-rails-0.56.3 spec_app/spec/javascripts/helpers/to_have_request_method.js.coffee
unpoly-rails-0.56.2 spec_app/spec/javascripts/helpers/to_have_request_method.js.coffee
unpoly-rails-0.56.1 spec_app/spec/javascripts/helpers/to_have_request_method.js.coffee
unpoly-rails-0.56.0 spec_app/spec/javascripts/helpers/to_have_request_method.js.coffee
unpoly-rails-0.55.1 spec_app/spec/javascripts/helpers/to_have_request_method.js.coffee
unpoly-rails-0.55.0 spec_app/spec/javascripts/helpers/to_have_request_method.js.coffee
unpoly-rails-0.54.1 spec_app/spec/javascripts/helpers/to_have_request_method.js.coffee
unpoly-rails-0.54.0 spec_app/spec/javascripts/helpers/to_have_request_method.js.coffee
unpoly-rails-0.53.4 spec_app/spec/javascripts/helpers/to_have_request_method.js.coffee
unpoly-rails-0.53.3 spec_app/spec/javascripts/helpers/to_have_request_method.js.coffee
unpoly-rails-0.53.2 spec_app/spec/javascripts/helpers/to_have_request_method.js.coffee
unpoly-rails-0.53.1 spec_app/spec/javascripts/helpers/to_have_request_method.js.coffee
unpoly-rails-0.53.0 spec_app/spec/javascripts/helpers/to_have_request_method.js.coffee
unpoly-rails-0.52.0 spec_app/spec/javascripts/helpers/to_have_request_method.js.coffee
unpoly-rails-0.51.1 spec_app/spec/javascripts/helpers/to_have_request_method.js.coffee