Browse Source

test: that status=incomplete when mandatory info is missing

pull/987/head
Sam Seed 4 years ago
parent
commit
b20f8bba6f
  1. 28
      spec/models/location_spec.rb

28
spec/models/location_spec.rb

@ -119,6 +119,34 @@ RSpec.describe Location, type: :model do
Timecop.freeze(2022, 6, 7)
end
context "when location is missing some mandatory information" do
it "returns incomplete when the postcode is missing" do
location.postcode = nil
expect(location.status).to eq(:incomplete)
location.postcode = ' '
expect(location.status).to eq(:incomplete)
end
it "returns incomplete when the number of units is missing" do
location.units = nil
expect(location.status).to eq(:incomplete)
end
it "returns incomplete when the unit type is missing" do
location.type_of_unit = nil
expect(location.status).to eq(:incomplete)
location.type_of_unit = ' '
expect(location.status).to eq(:incomplete)
end
it "returns incomplete when the mobility type is missing" do
location.mobility_type = nil
expect(location.status).to eq(:incomplete)
location.mobility_type = ' '
expect(location.status).to eq(:incomplete)
end
end
after do
Timecop.unfreeze
end

Loading…
Cancel
Save