Sha256: 2ef8b6dc374bf35b671c2806fa1d9d597d1ae30dcfc34ff27385481a3bc789cd
Contents?: true
Size: 632 Bytes
Versions: 14
Compression:
Stored size: 632 Bytes
Contents
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
14 entries across 14 versions & 1 rubygems