Sha256: 75b566bc4df1e6e343ce29a1a995d8dcd9b7d05ba058bf413d3d0a43cce752b5

Contents?: true

Size: 641 Bytes

Versions: 1

Compression:

Stored size: 641 Bytes

Contents

require 'test_helper'

describe 'Document' do
  describe Person do
    subject { Person }

    it { must be_document }
    it { must be_timestamped }
    unless Mongoid::VERSION == '4.0.0'
      it { must be_paranoid }
      it { must be_versioned }
    end

    it { must be_stored_in(:people) }

    it { must have_field(:name).of_type(String).with_default_value('me') }
    it { must have_fields(:name, :login).of_type(String).with_default_value('me') }

    it { must have_index_for(:name) }
    it { must have_index_for(:email, :login) }
  end

  describe Pet do
    subject { Pet }

    it { must have_index_for(:owner_id) }
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mongoid-minitest-1.0.0 test/matchers/document_test.rb