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

Version Path
mongo_mapper-0.12.0 test/unit/associations/test_belongs_to_association.rb
lookout-mongo_mapper-0.11.3 test/unit/associations/test_belongs_to_association.rb
mongo_mapper-0.11.2 test/unit/associations/test_belongs_to_association.rb
jamieorc-mongo_mapper-0.11.1.1 test/unit/associations/test_belongs_to_association.rb
mongo_mapper-0.11.1 test/unit/associations/test_belongs_to_association.rb
mongo_mapper-0.11.0 test/unit/associations/test_belongs_to_association.rb
mongo_mapper-0.10.1 test/unit/associations/test_belongs_to_association.rb
mongo_mapper-0.10.0 test/unit/associations/test_belongs_to_association.rb
mongo_mapper-0.9.2 test/unit/associations/test_belongs_to_association.rb
mongo_mapper-0.9.1 test/unit/associations/test_belongs_to_association.rb
mongo_mapper-0.9.0 test/unit/associations/test_belongs_to_association.rb