Sha256: 8312c6b8ad1ccdef4ce748c9d8ae142fb1a226e4cf7c44c44466061a633c282c

Contents?: true

Size: 473 Bytes

Versions: 1

Compression:

Stored size: 473 Bytes

Contents

require 'spec_helper'

RSpec.describe Grape::App::Helpers::Params do
  include Rack::Test::Methods

  let(:app) { TestAPI }

  it 'limits params' do
    post '/articles', title: 'Today', fresh: true, id: 1234, updated_at: Time.now
    expect(last_response.status).to eq(201)
    expect(JSON.parse(last_response.body)).to eq(
      'created_at' => nil,
      'id'         => 9,
      'title'      => 'Today',
      'updated_at' => '2018-01-05 11:25:15 UTC',
    )
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
grape-app-0.8.7 spec/grape/app/helpers/params_spec.rb