1
0
Fork 0
This repository has been archived on 2023-03-27. You can view files and clone it, but cannot push or open issues or pull requests.
lpr-partynest/spec/models/regional_office_spec.rb

22 lines
510 B
Ruby
Raw Normal View History

2018-12-06 17:49:50 -05:00
# frozen_string_literal: true
require 'rails_helper'
RSpec.describe RegionalOffice do
subject { create :regional_office }
it { is_expected.to belong_to :country_state }
2018-12-06 18:00:15 -05:00
it { is_expected.to have_many(:membership_apps).through(:country_state) }
2018-12-14 23:09:43 -05:00
it { is_expected.to have_many(:people).dependent(:restrict_with_exception) }
2018-12-06 17:49:50 -05:00
it do
is_expected.to \
validate_presence_of(:country_state)
.with_message(:required)
end
2019-03-23 21:42:27 -04:00
it { is_expected.to validate_uniqueness_of :country_state }
2018-12-06 17:49:50 -05:00
end