Sha256: d3ef5e15d12e3f6d0299eec8d3eed76889bc2d090b5373ae9442f04cb535e140

Contents?: true

Size: 569 Bytes

Versions: 1

Compression:

Stored size: 569 Bytes

Contents

require 'spec_helper'

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

  it { is_expected.to belong_to(:occupation_group) }
  it { is_expected.to have_many(:occupation_subgroups).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 = '01'
    subject.name = 'MEMBROS DAS FORÇAS ARMADAS'

    expect(subject.to_s).to eq '01 - MEMBROS DAS FORÇAS ARMADAS'
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

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