spec/association_spec.rb in schema_associations-1.0.0 vs spec/association_spec.rb in schema_associations-1.0.1
- old
+ new
@@ -225,9 +225,17 @@
reflection.macro.should == :has_one
reflection.options[:class_name].should == "Comment"
reflection.options[:foreign_key].should == "post_id"
reflection.options[:inverse_of].should == :post
end
+ it "should create belongs_to association with singular inverse" do
+ reflection = Comment.reflect_on_association(:post)
+ reflection.should_not be_nil
+ reflection.macro.should == :belongs_to
+ reflection.options[:class_name].should == "Post"
+ reflection.options[:foreign_key].should == "post_id"
+ reflection.options[:inverse_of].should == :comment
+ end
end
context "with prefixed column names" do
before(:each) do
create_tables(