Sha256: 963f97bdc0980a3cfe6ffae67d33cf4332ac595f1435c5a9077f76ee650f835e
Contents?: true
Size: 739 Bytes
Versions: 16
Compression:
Stored size: 739 Bytes
Contents
require File.join(File.dirname(__FILE__), "/../../../spec_helper.rb") describe Mongoid::Associations::HasOneAssociation do before do @attributes = { :name => { :first_name => "Drexel" } } @document = stub(:attributes => @attributes) end describe "#method_missing" do before do @association = Mongoid::Associations::HasOneAssociation.new(:name, @document) end context "when getting values" do it "delegates to the document" do @association.first_name.should == "Drexel" end end context "when setting values" do it "delegates to the document" do @association.first_name = "Test" @association.first_name.should == "Test" end end end end
Version data entries
16 entries across 16 versions & 2 rubygems