Sha256: 9ca0d8debbb8f2c6ac7ead0fae7f9e3065cfd8a5c6da0be7c76a0feadc2699aa

Contents?: true

Size: 871 Bytes

Versions: 3

Compression:

Stored size: 871 Bytes

Contents

require 'spec_helper'

describe "Document" do
  describe User do
    it { should have_fields(:email, :login) }
    it { should be_timestamped_document }
    it { should be_timestamped_document.with(:created) }
    it { should_not be_timestamped_document.with(:updated) }
  end

  describe Article do
    it { should have_field(:published).of_type(Mongoid::Boolean).with_default_value_of(false) }
    it { should have_field(:allow_comments).of_type(Mongoid::Boolean).with_default_value_of(true) }
    it { should belong_to(:author) }
    it { should have_field(:title).localized }
    it { should_not have_field(:allow_comments).of_type(Mongoid::Boolean).with_default_value_of(false) }
    it { should_not have_field(:number_of_comments).of_type(Integer).with_default_value_of(1) }
    it { should be_mongoid_document }
    it { should be_timestamped_document }
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
mongoid-rspec-2.0.0 spec/unit/document_spec.rb
mongoid-rspec-2.0.0.rc1 spec/unit/document_spec.rb
mongoid4-rspec-1.11.0 spec/unit/document_spec.rb