Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added a spec for many-to-many

  • Loading branch information...
commit 8c24e7cbab17cab7ba7d605cb448c04d5bba7467 1 parent 09e1509
@andykent andykent authored Dan Kubb committed
Showing with 12 additions and 34 deletions.
  1. +12 −34 spec/unit/associations_spec.rb
View
46 spec/unit/associations_spec.rb
@@ -87,41 +87,19 @@ class Manufacturer
:class_name => 'Car'
end
end
+
+ it "should create a many-to-many relationship if references are circular" do
+ Manufacturer.should_receive(:many_to_many).
+ with(:vehicles,{}).
+ and_return(@relationship)
+ class Manufacturer
+ has n, :vehicles
+ end
+ class Vehicle
+ has n, :manufacturers
+ end
+ end
end
-
- # describe "many-to-many syntax" do
- # it "should create a basic many-to-one association with no constraints" do
- # Manufacturer.should_receive(:many_to_many).
- # with(:vehicles,{}).
- # and_return(@relationship)
- # class Manufacturer
- # has n..n, :vehicles
- # end
- # end
- #
- # it "should create a many-to-many association with fixed constraints" do
- # Manufacturer.should_receive(:many_to_many).
- # with(:vehicles, :left=>{:min=>4, :max=>4}, :right=>{:min=>4, :max=>4}).
- # and_return(@relationship)
- # class Manufacturer
- # has 4..4, :vehicles
- # end
- # end
- #
- # it "should create a many-to-many association with min/max constraints" do
- # pending
- # end
- #
- # it "should create a many-to-many association with options" do
- # Manufacturer.should_receive(:many_to_many).
- # with(:vehicles,{:class_name => 'Car'}).
- # and_return(@relationship)
- # class Manufacturer
- # has n..n, :vehicles,
- # :class_name => 'Car'
- # end
- # end
- # end
end
describe ".belongs_to" do
Please sign in to comment.
Something went wrong with that request. Please try again.