Browse Source

Check all new records have correct validator

pull/297/head
baarkerlounger 4 years ago
parent
commit
b66518e329
  1. 14
      spec/models/case_log_spec.rb

14
spec/models/case_log_spec.rb

@ -18,6 +18,20 @@ RSpec.describe CaseLog do
end
describe "#new" do
context "when creating a record" do
let(:case_log) do
described_class.create(
owning_organisation: owning_organisation,
managing_organisation: managing_organisation,
)
end
it "attaches the correct custom validator" do
expect(case_log._validators.values.flatten.map(&:class))
.to include(CaseLogValidator)
end
end
# TODO: replace these with validator specs and checks for method call here
context "when a reasonable preference is set to yes" do
it "validates that previously homeless should be selected" do

Loading…
Cancel
Save