Sha256: 85227d70fc7d809afb2b9fba8da73e55ff994cb31889c02e047ae657bf39bc53

Contents?: true

Size: 571 Bytes

Versions: 41

Compression:

Stored size: 571 Bytes

Contents

require 'spec_helper'
require 'gris/grape_extensions/crud_helpers'

describe Gris::CrudHelpers do
  before do
    @helper = SpecCrudHelper.new
  end

  it 'returns permitted_params' do
    @helper.params = { id: 1 }
    expect(@helper.permitted_params).to eq(id: 1)
  end

  it 'uses date time helpers' do
    @helper.datetime_params :created_at
    @helper.params = { message: 'hi', created_at: 1_293_901_200 }
    expected = {
      created_at: 'Sat, 01 Jan 2011 17:00:00 +0000',
      message: 'hi'
    }
    expect(@helper.permitted_params).to eq(expected)
  end
end

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
gris-0.6.8 spec/grape_extensions/crud_helpers_spec.rb
gris-0.6.7 spec/grape_extensions/crud_helpers_spec.rb
gris-0.6.6 spec/grape_extensions/crud_helpers_spec.rb
gris-0.6.5 spec/grape_extensions/crud_helpers_spec.rb
gris-0.6.2 spec/grape_extensions/crud_helpers_spec.rb
gris-0.6.1 spec/grape_extensions/crud_helpers_spec.rb
gris-0.6.0 spec/grape_extensions/crud_helpers_spec.rb
gris-0.5.9 spec/grape_extensions/crud_helpers_spec.rb
gris-0.5.8 spec/grape_extensions/crud_helpers_spec.rb
gris-0.5.7 spec/grape_extensions/crud_helpers_spec.rb
gris-0.5.6 spec/grape_extensions/crud_helpers_spec.rb
gris-0.5.5 spec/grape_extensions/crud_helpers_spec.rb
gris-0.5.4 spec/grape_extensions/crud_helpers_spec.rb
gris-0.5.3 spec/grape_extensions/crud_helpers_spec.rb
gris-0.5.2 spec/grape_extensions/crud_helpers_spec.rb
gris-0.5.1 spec/grape_extensions/crud_helpers_spec.rb
gris-0.5.0 spec/grape_extensions/crud_helpers_spec.rb
gris-0.4.9 spec/grape_extensions/crud_helpers_spec.rb
gris-0.4.8 spec/grape_extensions/crud_helpers_spec.rb
gris-0.4.7 spec/grape_extensions/crud_helpers_spec.rb