Sha256: 94ae70b70c6b6a418d048801c884038e2cd64e14355b02f57f285a4daeea9ff9

Contents?: true

Size: 752 Bytes

Versions: 5

Compression:

Stored size: 752 Bytes

Contents

require 'rails_helper'

module Mks
  module Rate
    RSpec.describe ServiceType, type: :model do
      it 'has a valid factory' do
        expect(create(:service_type)).to be_valid
      end

      it 'is invalid with no code' do
        expect(build(:service_type, code: nil)).not_to be_valid
      end

      it 'is invalid with no name' do
        expect(build(:service_type, name: nil)).not_to be_valid
      end

      it 'is invalid with duplicate code' do
        st = create(:service_type)
        expect(build(:service_type, code: st.code)).not_to be_valid
      end

      it 'is invalid with duplicate name' do
        st = create(:service_type)
        expect(build(:service_type, name: st.name)).not_to be_valid
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
mks_rate-1.0.5 spec/models/mks/rate/service_type_spec.rb
mks_rate-1.0.4 spec/models/mks/rate/service_type_spec.rb
mks_rate-1.0.3 spec/models/mks/rate/service_type_spec.rb
mks_rate-1.0.2 spec/models/mks/rate/service_type_spec.rb
mks_rate-1.0.1 spec/models/mks/rate/service_type_spec.rb