Sha256: 8a51be5b60b53f39ce3918204e62c3695d90b48c743b6c97c049a37d7b8e6659
Contents?: true
Size: 744 Bytes
Versions: 9
Compression:
Stored size: 744 Bytes
Contents
require 'rails_helper' module Logistics module Core RSpec.describe UnitType, type: :model do it 'has a valid factory' do expect(create(:unit_type)).to be_valid end it 'is invalid with no code' do expect(build(:unit_type, :code => '')).not_to be_valid end it 'is invalid with no name' do expect(build(:unit_type, :name => '')).not_to be_valid end it 'is invalid with duplicate code' do ut = create(:unit_type) expect(build(:unit_type, :code => ut.code)).not_to be_valid end it 'is invalid with duplicate name' do ut = create(:unit_type) expect(build(:unit_type, :name => ut.name)).not_to be_valid end end end end
Version data entries
9 entries across 9 versions & 1 rubygems