Sha256: 83c3c1b6b36f6a322dfcaeb2dc1a51b2519ee6eb1cd42c4109ed02cf843dc6ae

Contents?: true

Size: 309 Bytes

Versions: 4

Compression:

Stored size: 309 Bytes

Contents

require "spec_helper"

describe Mongoid::Factory do

  describe ".build" do

    before do
      @attributes = { "_type" => "Person", "title" => "Sir" }
    end

    it "instantiates based on the type" do
      person = Mongoid::Factory.build(@attributes)
      person.title.should == "Sir"
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
mongoid-1.2.3 spec/unit/mongoid/factory_spec.rb
mongoid-1.2.2 spec/unit/mongoid/factory_spec.rb
mongoid-1.2.1 spec/unit/mongoid/factory_spec.rb
mongoid-1.2.0 spec/unit/mongoid/factory_spec.rb