Sha256: e67184b5cc92993387d745bce838ec82ce3dfd78d351066215bc272e622dcadf
Contents?: true
Size: 664 Bytes
Versions: 41
Compression:
Stored size: 664 Bytes
Contents
# frozen_string_literal: true module BetterRecord module Rspec module Extensions def has_valid_factory(factory_name, count = 10) it "has a valid factory" do records = [] count = (count.to_i == 0) ? 1 : count.to_i count.times do test_factory = build(*factory_name) unless test_factory.valid? puts test_factory.errors.full_messages end expect(test_factory.valid?).to be true expect(test_factory.save).to be true records << test_factory end records.each {|f| f.destroy} end end end end end
Version data entries
41 entries across 41 versions & 1 rubygems