【发布时间】:2013-09-17 19:24:50
【问题描述】:
看看这个:
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
最后的期望失败了。这是为什么?如果我在控制台中执行相同的步骤,它会按预期工作。
【问题讨论】:
标签: ruby-on-rails activerecord activemodel