require 'rails_helper'

RSpec.describe Contabilidade::AcaoDoContigenciamento, type: :model do
  describe 'associations' do
    it { should belong_to(:orcamento_do_contingenciamento) }
    it { should belong_to(:acao).class_name('Loa::Acao') }
    it { should have_many(:elementos_por_acao_do_contigenciamento) }
    it { should accept_nested_attributes_for(:elementos_por_acao_do_contigenciamento).allow_destroy(true) }
  end

  describe 'validations' do
    it { should validate_presence_of(:acao_id) }
  end
end
