Sha256: 21b199f76db5cc3f55dfe108f4676804f0dea18c2c8d8ee8e192f74db6e1a994

Contents?: true

Size: 358 Bytes

Versions: 11

Compression:

Stored size: 358 Bytes

Contents

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

11 entries across 11 versions & 2 rubygems

Version Path
grape-extra_validators-2.0.0 vendor/bundle/ruby/2.6.0/gems/grape-1.2.5/spec/support/content_type_helpers.rb
grape-extra_validators-1.0.0 vendor/bundle/ruby/2.4.0/gems/grape-1.2.5/spec/support/content_type_helpers.rb
grape-1.2.5 spec/support/content_type_helpers.rb
grape-1.2.4 spec/support/content_type_helpers.rb
grape-1.2.3 spec/support/content_type_helpers.rb
grape-1.2.2 spec/support/content_type_helpers.rb
grape-1.2.1 spec/support/content_type_helpers.rb
grape-1.2.0 spec/support/content_type_helpers.rb
grape-1.1.0 spec/support/content_type_helpers.rb
grape-1.0.3 spec/support/content_type_helpers.rb
grape-1.0.2 spec/support/content_type_helpers.rb