こんにちは私はrpecを書きたい私のEnrolledAccountモデルに次のメソッドを持っています。私の質問は、rspecでItemとEnrolledAccountの間に関連付けを作成するにはどうすればよいですか。
def delete_account
items = self.items
item_array = items.blank? ? [] : items.collect {|i| i.id }
ItemShippingDetail.destroy_all(["item_id in (?)", item_array]) unless item_array.blank?
ItemPaymentDetail.destroy_all(["item_id in (?)", item_array]) unless item_array.blank?
Item.delete_all(["enrolled_account_id = ?", self.id])
self.delete
end