require 'rails_helper' module Mks module Rate RSpec.describe ServiceRate, type: :model do it 'has valid factory' do expect(create(:service_rate)).to be_valid end it 'is invalid without utilization rate' do expect(build(:service_rate, utilization_rate: nil)).not_to be_valid end it 'is invalid without base rate' do expect(build(:service_rate, base_rate: nil)).not_to be_valid end it 'is invalid without chargeable service' do expect(build(:service_rate, chargeable_service_id: nil)).not_to be_valid end end end end