spec/association_spec.rb in schema_associations-0.1.1 vs spec/association_spec.rb in schema_associations-0.1.2
- old
+ new
@@ -176,17 +176,32 @@
check_reflections(:owner => true, :colors => false, :parts => true, :manifest => true)
end
end
- it "should override auto_create positively" do
+ it "should override auto_create positively explicitly" do
with_associations_auto_create(false) do
create_tables(
"posts", {}, {},
"comments", {}, { :post_id => {} }
)
class Post < ActiveRecord::Base
schema_associations :auto_create => true
+ end
+ class Comment < ActiveRecord::Base ; end
+ Post.reflect_on_association(:comments).should_not be_nil
+ Comment.reflect_on_association(:post).should be_nil
+ end
+ end
+
+ it "should override auto_create positively implicitly" do
+ with_associations_auto_create(false) do
+ create_tables(
+ "posts", {}, {},
+ "comments", {}, { :post_id => {} }
+ )
+ class Post < ActiveRecord::Base
+ schema_associations
end
class Comment < ActiveRecord::Base ; end
Post.reflect_on_association(:comments).should_not be_nil
Comment.reflect_on_association(:post).should be_nil
end