My scenario was pretty much like this: Student belongs to Class.
My test: a student should know what class it belongs to.
it "should know what class it belongs to"Failed! Apparently, you cannot insert into the array "<<". You need to do it like this:
@student = Student.new
@class = Class.new(:name => "Math")
@class.students << @student
@student.class.name.should == "Math"
@student.class = @classWell, I'm not that stupid that it'd take me 3 hours to figure that out! My test was longer of course! I just made it simple for example's sake. :P