Permalink
Browse files

Working on fixing test associations (WIP)

  • Loading branch information...
1 parent 01d76a5 commit 73ffd6eb1e1e9a86be9675fccd95e17c35be7e3e Kurt Preston committed Apr 13, 2012
Showing with 8 additions and 2 deletions.
  1. +1 −1 Gemfile.lock
  2. +7 −1 spec/daddys_girl_spec.rb
View
2 Gemfile.lock
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
- daddys_girl (0.5.0)
+ daddys_girl (0.6.0)
activerecord (~> 3.0.0)
factory_girl (~> 2.0)
View
8 spec/daddys_girl_spec.rb
@@ -6,14 +6,19 @@
factory :test_class do
name 'Test Name'
end
+
+ factory :test_association
end
end
before(:each) do
define_model('TestClass', {:name => :string})
+ define_model('TestAssociation', {})
TestClass.class_eval do
validates_format_of :name, :with => /^[^!]+$/
+ has_many :test_associations
end
+ @test_object = TestClass.new
end
describe "ActiveRecord::Base#spawn" do
@@ -60,7 +65,8 @@
describe "ActiveRecord::Associations::AssociationProxy.spawn" do
it "creates a new object without saving" do
- spawn
+ @test_object.test_associations.spawn.class.should == TestAssociation
+ @test_object.test_associations.spawn.id.should be_nil
end
end

0 comments on commit 73ffd6e

Please sign in to comment.