Sha256: 4e71910ecf2eb918e3fc323fa5ae3e1055de31779780652b6097a04c68c5e27f

Contents?: true

Size: 615 Bytes

Versions: 5

Compression:

Stored size: 615 Bytes

Contents

require 'rails_helper'

module Mks
  module Rate
    RSpec.describe UnitOfCharge, type: :model do
      it 'has valid factory' do
        expect(build(:unit_of_charge)).to be_valid
      end

      it 'is invalid without name' do
        expect(build(:unit_of_charge, name: nil)).not_to be_valid
      end

      it 'is invalid without unit variables' do
        expect(build(:unit_of_charge, unit_variables: {})).not_to be_valid
      end

      it 'can not have same name' do
        uoc = create(:unit_of_charge)
        expect(build(:unit_of_charge, name: uoc.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/unit_of_charge_spec.rb
mks_rate-1.0.4 spec/models/mks/rate/unit_of_charge_spec.rb
mks_rate-1.0.3 spec/models/mks/rate/unit_of_charge_spec.rb
mks_rate-1.0.2 spec/models/mks/rate/unit_of_charge_spec.rb
mks_rate-1.0.1 spec/models/mks/rate/unit_of_charge_spec.rb