Sha256: 8ad6e77d3527d3bb18b4bb25080b31024871f30f51836899e0ed637e9ff173c5

Contents?: true

Size: 616 Bytes

Versions: 3

Compression:

Stored size: 616 Bytes

Contents

require 'active_record'
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
require 'spec/active_record/fixtures/fruit'
require 'spec/active_record/fixtures/tree'

databases = YAML::load(IO.read("spec/active_record/fixtures/database.yml"))
db_info = databases[ENV["DB"] || "test"]
ActiveRecord::Base.establish_connection(db_info)

describe ActiveRecord::Base do
  it "should allow calling blueprint on associations" do
    tree = Tree.blueprint(:name => 'tree')
    fruit = tree.fruits.blueprint(:species => 'fruit')
    fruit.should be_instance_of(Fruit)
    fruit.species.should == 'fruit'
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
blueprints-0.8.2 spec/unit/active_record_spec.rb
blueprints-0.8.1 spec/unit/active_record_spec.rb
blueprints-0.8.0 spec/unit/active_record_spec.rb