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.4.6 spec/grape_extensions/crud_helpers_spec.rb
gris-0.4.5 spec/grape_extensions/crud_helpers_spec.rb
gris-0.4.4 spec/grape_extensions/crud_helpers_spec.rb
gris-0.4.3 spec/grape_extensions/crud_helpers_spec.rb
gris-0.4.2 spec/grape_extensions/crud_helpers_spec.rb
gris-0.4.0 spec/grape_extensions/crud_helpers_spec.rb
gris-0.3.9 spec/grape_extensions/crud_helpers_spec.rb
gris-0.3.8 spec/grape_extensions/crud_helpers_spec.rb
gris-0.3.7 spec/grape_extensions/crud_helpers_spec.rb
gris-0.3.6 spec/grape_extensions/crud_helpers_spec.rb
gris-0.3.4 spec/grape_extensions/crud_helpers_spec.rb
gris-0.3.3 spec/grape_extensions/crud_helpers_spec.rb
gris-0.3.2 spec/grape_extensions/crud_helpers_spec.rb
gris-0.3.1 spec/grape_extensions/crud_helpers_spec.rb
gris-0.3.0 spec/grape_extensions/crud_helpers_spec.rb
gris-0.2.4 spec/grape_extensions/crud_helpers_spec.rb
gris-0.2.3 spec/grape_extensions/crud_helpers_spec.rb
gris-0.2.2 spec/grape_extensions/crud_helpers_spec.rb
gris-0.2.1 spec/grape_extensions/crud_helpers_spec.rb
gris-0.2.0 spec/grape_extensions/crud_helpers_spec.rb