Sha256: df553a4bfa137c0836ecbd3f8120f8e7c9caa2df21abdab6b7d676ba588fc46d
Contents?: true
Size: 517 Bytes
Versions: 41
Compression:
Stored size: 517 Bytes
Contents
# frozen_string_literal: true module BetterRecord module Rspec module Extensions def optional_column(factory_name, column_name, &blk) describe column_name.to_s do let(:record) { build(factory_name) } it "is optional" do record.__send__"#{column_name}=", nil expect(record.valid?).to be true expect(record.errors[column_name]).to be_empty end instance_eval(&blk) if block_given? end end end end end
Version data entries
41 entries across 41 versions & 1 rubygems