Sha256: eb141031430f8950021e32f6ef2c46327c8ac6b7666c23b2382875cbcd80e012
Contents?: true
Size: 849 Bytes
Versions: 9
Compression:
Stored size: 849 Bytes
Contents
require 'rails_helper' module Logistics module Core RSpec.describe DocumentTypeCategory, type: :model do it 'has a valid factory' do expect(create(:document_type_category)).to be_valid end it 'is invalid without a code' do expect(build(:document_type_category, code: nil)).not_to be_valid end it 'is invalid without a name' do expect(build(:document_type_category, name: nil)).not_to be_valid end it "is invalid with a duplicate code" do dtc = create(:document_type_category) expect(build(:document_type_category, code: dtc.code)).not_to be_valid end it 'is invalid with a duplicate name' do dtc = create(:document_type_category) expect(build(:document_type_category, name: dtc.name)).not_to be_valid end end end end
Version data entries
9 entries across 9 versions & 1 rubygems