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

36 lines
715 B
Ruby
Raw Normal View History

2019-04-27 10:24:04 -04:00
# frozen_string_literal: true
require 'rails_helper'
RSpec.describe Relationship do
subject { create :supporter_relationship }
2019-09-28 17:21:34 -04:00
describe '#status' do
it do
is_expected.to belong_to(:status).class_name('RelationStatus').required
end
end
2019-07-20 06:07:02 -04:00
describe '#person' do
it do
is_expected.to belong_to(:person).inverse_of(:all_relationships).required
end
2019-07-20 06:07:02 -04:00
end
describe '#regional_office' do
it do
2019-08-17 23:55:12 -04:00
is_expected.to belong_to(:regional_office).required
end
2019-07-20 06:07:02 -04:00
end
2019-04-28 08:48:51 -04:00
describe '#from_date' do
it { is_expected.to validate_presence_of :from_date }
2019-04-28 09:24:01 -04:00
it do
is_expected.to \
validate_uniqueness_of(:from_date)
2019-07-20 02:02:32 -04:00
.scoped_to(:person_id)
2019-04-28 09:24:01 -04:00
end
end
2019-04-27 10:24:04 -04:00
end