Sha256: f141b3a4c688fa6e535bafdd9ab6c269a7f63222a38e90338964b7e51ea27d66

Contents?: true

Size: 389 Bytes

Versions: 16

Compression:

Stored size: 389 Bytes

Contents

# frozen_string_literal: true

module Spec
  module Support
    module Helpers
      %w[put patch post delete].each do |method|
        define_method :"#{method}_with_json" do |uri, params = {}, env = {}, &block|
          params = params.to_json
          env['CONTENT_TYPE'] ||= 'application/json'
          send(method, uri, params, env, &block)
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
grape-1.8.0 spec/support/content_type_helpers.rb
grape-1.7.1 spec/support/content_type_helpers.rb
grape-1.7.0 spec/support/content_type_helpers.rb
grape-1.6.2 spec/support/content_type_helpers.rb
grape-1.6.1 spec/support/content_type_helpers.rb
grape-1.6.0 spec/support/content_type_helpers.rb
grape-1.5.3 spec/support/content_type_helpers.rb
grape-1.5.2 spec/support/content_type_helpers.rb
grape-1.5.1 spec/support/content_type_helpers.rb
grape-1.5.0 spec/support/content_type_helpers.rb
grape-extra_validators-2.0.0 vendor/bundle/ruby/2.6.0/gems/grape-1.4.0/spec/support/content_type_helpers.rb
grape-1.4.0 spec/support/content_type_helpers.rb
grape-1.3.3 spec/support/content_type_helpers.rb
grape-1.3.2 spec/support/content_type_helpers.rb
grape-1.3.1 spec/support/content_type_helpers.rb
grape-1.3.0 spec/support/content_type_helpers.rb