Sha256: 2e2dc7c2561b6d0b0c6c6452dd9a26f462c20d17b50d6db913a910ca2e3b1aea
Contents?: true
Size: 801 Bytes
Versions: 11
Compression:
Stored size: 801 Bytes
Contents
require 'test_helper' require 'models' class BelongsToAssociationTest < Test::Unit::TestCase include MongoMapper::Plugins::Associations context "class_name" do should "camelize the name" do BelongsToAssociation.new(:user).class_name.should == 'User' end should "be changeable using class_name option" do association = BelongsToAssociation.new(:user, :class_name => 'Person') association.class_name.should == 'Person' end end context "embeddable?" do should "be false even if class is embeddable" do base = BelongsToAssociation.new(:address) base.embeddable?.should be_false end should "be false if class is not embeddable" do base = BelongsToAssociation.new(:project) base.embeddable?.should be_false end end end
Version data entries
11 entries across 11 versions & 3 rubygems