Sha256: f8549f89c23358ba4586adfdc2feefe40652144a31d08595dcdb48e2c95bd61a
Contents?: true
Size: 809 Bytes
Versions: 8
Compression:
Stored size: 809 Bytes
Contents
require File.join(File.dirname(__FILE__), "/../../spec_helper.rb") describe Mongoid::Attributes do describe "#process" do context "when supplied hash has values" do before do @attributes = { :_id => "1", :title => "value", :age => "30", :terms => "true", :name => { :_id => "2", :first_name => "Test", :last_name => "User" }, :addresses => [ { :_id => "3", :street => "First Street" }, { :_id => "4", :street => "Second Street" } ] } end it "returns a properly cast HashWithIndifferentAccess" do attrs = Person.new(@attributes).attributes attrs[:age].should == 30 attrs[:terms].should == true end end end end
Version data entries
8 entries across 8 versions & 1 rubygems