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/country_state_spec.rb

28 lines
658 B
Ruby
Raw Normal View History

2018-11-30 11:24:05 -05:00
# frozen_string_literal: true
require 'rails_helper'
2018-11-30 11:32:43 -05:00
RSpec.describe CountryState do
subject { create :country_state }
2018-11-30 11:24:05 -05:00
2018-12-06 17:49:50 -05:00
it do
is_expected.to \
have_one(:regional_office)
.dependent(:restrict_with_exception)
end
it do
is_expected.to \
have_many(:membership_apps)
.dependent(:restrict_with_exception)
end
2018-12-06 17:49:50 -05:00
it { is_expected.not_to validate_presence_of :regional_office }
2019-03-24 16:52:10 -04:00
it { is_expected.to validate_presence_of :english_name }
2019-03-24 17:10:10 -04:00
it { is_expected.to validate_presence_of :native_name }
2018-11-30 11:24:05 -05:00
2019-03-24 16:52:10 -04:00
it { is_expected.to validate_uniqueness_of :english_name }
2019-03-24 17:10:10 -04:00
it { is_expected.to validate_uniqueness_of :native_name }
2018-11-30 11:24:05 -05:00
end