Browse Source

test: update test text to match what's being tested

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

4
spec/models/location_spec.rb

@ -39,7 +39,7 @@ RSpec.describe Location, type: :model do
describe "#units" do describe "#units" do
let(:location) { FactoryBot.build(:location) } let(:location) { FactoryBot.build(:location) }
it "does add an error when the postcode is invalid" do it "does add an error when the number of units is invalid" do
location.units = nil location.units = nil
expect { location.save! } expect { location.save! }
.to raise_error(ActiveRecord::RecordInvalid, "Validation failed: Units #{I18n.t('activerecord.errors.models.location.attributes.units.blank')}") .to raise_error(ActiveRecord::RecordInvalid, "Validation failed: Units #{I18n.t('activerecord.errors.models.location.attributes.units.blank')}")
@ -49,7 +49,7 @@ RSpec.describe Location, type: :model do
describe "#type_of_unit" do describe "#type_of_unit" do
let(:location) { FactoryBot.build(:location) } let(:location) { FactoryBot.build(:location) }
it "does add an error when the postcode is invalid" do it "does add an error when the type of unit is invalid" do
location.type_of_unit = nil location.type_of_unit = nil
expect { location.save! } expect { location.save! }
.to raise_error(ActiveRecord::RecordInvalid, "Validation failed: Type of unit #{I18n.t('activerecord.errors.models.location.attributes.type_of_unit.blank')}") .to raise_error(ActiveRecord::RecordInvalid, "Validation failed: Type of unit #{I18n.t('activerecord.errors.models.location.attributes.type_of_unit.blank')}")

Loading…
Cancel
Save