Sha256: 2d3e86af051c583cc05b68e091d918d206254c3b059a9f7142f82412b70939ec

Contents?: true

Size: 435 Bytes

Versions: 4

Compression:

Stored size: 435 Bytes

Contents

require 'spec_helper'

describe "A document loaded from rails" do
  before(:all) do
    require 'mongoid/railties/document'
  end

  after(:all) do
    Mongoid::Document.class_eval do
      undef _destroy
    end
  end

  it "defines a _destroy method" do
    expect(Person.new).to respond_to(:_destroy)
  end

  describe "#_destroy" do

    it "always returns false" do
      expect(Person.new._destroy).to be_false
    end
  end
end

Version data entries

4 entries across 4 versions & 3 rubygems

Version Path
sepastian-mongoid-rails4-4.0.1.alpha spec/mongoid/railties/document_spec.rb
sepastian-mongoid-rails4-4.0.0.alpha spec/mongoid/railties/document_spec.rb
mongoid_heroku_stable-4.0.0 spec/mongoid/railties/document_spec.rb
mongoid_rails4-4.0.0 spec/mongoid/railties/document_spec.rb