Sha256: 5b3adb9f9672b8a19f41a45b100ddb88195d97ef8fd9415ee5709d01f32826e1

Contents?: true

Size: 358 Bytes

Versions: 4

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

4 entries across 4 versions & 1 rubygems

Version Path
grape-1.0.1 spec/support/content_type_helpers.rb
grape-1.0.0 spec/support/content_type_helpers.rb
grape-0.19.2 spec/support/content_type_helpers.rb
grape-0.19.1 spec/support/content_type_helpers.rb