看一下这个:
it "should not be this tough" do
was = obj.association_id
expect(obj.association_id).to eq 1
obj.association_id = 2 * was
expect(obj.association_id).to eq 2
expect(obj.association_id_changed?).to be_true
expect(obj.association_id_was).to be_present
end
最后的期望落空了。这是为什么?如果我在控制台中执行相同的步骤,它会按我的预期工作。