如何使用 Shoulda 测试引用类属性的named_scope?
我有以下 ActiveRecord 类: class User < ActiveRecord::Base cattr_accessor :current_user has_many :batch_records end class BatchRecord < Acti…
如何删除 shoulda 测试中的重复项?
这就是我所得到的: context "Create ingredient from string" do context "1 cups butter" do setup do @ingredient = Ingredient.create(:ingredien…