Sha256: f99ea26fea3785f6c166849056eed424116e51bed679857c13c0988614bbbf76

Contents?: true

Size: 918 Bytes

Versions: 1

Compression:

Stored size: 918 Bytes

Contents

require 'spec_helper'
require 'timecop'

describe 'RailsAdmin::Adapters::ActiveRecord::Property', active_record: true do
  describe 'string field' do
    subject { RailsAdmin::AbstractModel.new('Player').properties.detect { |f| f.name == :name } }

    it 'returns correct values' do
      expect(subject.pretty_name).to eq 'Name'
      expect(subject.type).to eq :string
      expect(subject.length).to eq 100
      expect(subject.nullable?).to be_falsey
      expect(subject.serial?).to be_falsey
    end
  end

  describe 'serialized field' do
    subject { RailsAdmin::AbstractModel.new('User').properties.detect { |f| f.name == :roles } }

    it 'returns correct values' do
      expect(subject.pretty_name).to eq 'Roles'
      expect(subject.type).to eq :serialized
      expect(subject.length).to eq 255
      expect(subject.nullable?).to be_truthy
      expect(subject.serial?).to be_falsey
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rails_admin-0.6.3 spec/rails_admin/adapters/active_record/property_spec.rb