Last active
August 29, 2015 14:00
-
-
Save macool/cb80c634b8a5ce37208f to your computer and use it in GitHub Desktop.
spec
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe 'If a geographical area has a parent geographical area group then the | |
validity period of the parent geographical area group must span the validity | |
period of the geographical area' do | |
describe "GA5" do | |
let(:geographical_area) { | |
build(:geographical_area, | |
validity_end_date: Date.today, | |
parent_geographical_area_group_sid: parent_id) | |
} | |
before { geographical_area.conformant? } | |
context "invalid parent period" do | |
context "start date" do | |
let(:parent_id) { | |
create(:geographical_area, validity_start_date: Date.yesterday) | |
} | |
it { | |
expect(geographical_area.conformance_errors).to have_key(:GA5) | |
} | |
end | |
context "end date" do | |
let(:parent_id) { | |
create(:geographical_area, validity_end_date: Date.yesterday ) | |
} | |
it { | |
expect(geographical_area.conformance_errors).to have_key(:GA5) | |
} | |
end | |
end | |
context "valid" do | |
let(:parent_id) { | |
create(:geographical_area, validity_end_date: Date.today) | |
} | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment