require 'rails_helper' RSpec.describe TbCommerce::Customization, type: :model do describe '#has_at_least_one_option' do it 'should require at least one option is present' do custom = FactoryGirl.build(:tb_commerce_customization, :input_type => 'list', :options => []) expect(custom).to be_invalid expect(custom.errors[:options].length).to eq(1) end end end