test/matchers/associations_test.rb in mongoid-minitest-0.0.1 vs test/matchers/associations_test.rb in mongoid-minitest-0.0.2
- old
+ new
@@ -1,15 +1,24 @@
require 'test_helper'
-describe Mongoid::Matchers::Associations do
+describe "Associations" do
- describe "have_many" do
+ describe Person do
subject { Person }
- it { must have_many(:pets) }
- it { wont have_many(:accounts) }
-
it { must have_many(:pets).of_type(Pet) }
- it { wont have_many(:pets).of_type(Person) }
+ it { must have_one(:account).of_type(Account) }
+ end
+
+ describe Pet do
+ subject { Pet }
+
+ it { must belong_to(:person).of_type(Person) }
+ end
+
+ describe Account do
+ subject { Account }
+
+ it { must belong_to(:person).of_type(Person) }
end
end