Sha256: bfac486c6502d36e81b6c52723ba8cad2b8fea04202e431c44ab47d300099a10

Contents?: true

Size: 574 Bytes

Versions: 1

Compression:

Stored size: 574 Bytes

Contents

require 'spec_helper'

describe OccupationGroup do
  it { is_expected.to be_a_kind_of Unico::OccupationGroup }

  it { is_expected.to have_many(:occupation_main_groups).dependent(:restrict_with_exception) }

  it { is_expected.to validate_presence_of :name }
  it { is_expected.to validate_presence_of :code }

  it 'cast to string using the code and name' do
    subject.code = '0'
    subject.name = 'MEMBROS DAS FORÇAS ARMADAS, POLICIAIS E BOMBEIROS MILITARES'

    expect(subject.to_s).to eq '0 - MEMBROS DAS FORÇAS ARMADAS, POLICIAIS E BOMBEIROS MILITARES'
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
unico-training-7.8.0 spec/models/occupation_group_spec.rb