Browse Source

code to implement correct validation - part 2

pull/671/head
JG 3 years ago
parent
commit
318aa3dcf2
  1. 5
      spec/models/scheme_spec.rb

5
spec/models/scheme_spec.rb

@ -8,11 +8,6 @@ RSpec.describe Scheme, type: :model do
expect(scheme.organisation).to be_a(Organisation) expect(scheme.organisation).to be_a(Organisation)
end end
it "validates organisation_id presence" do
expect { FactoryBot.create(:scheme, organisation: nil) }
.to raise_error(ActiveRecord::RecordInvalid, "Validation failed: Provider type #{I18n.t('validations.scheme.id_missing')}")
end
describe "scopes" do describe "scopes" do
let!(:scheme_1) { FactoryBot.create(:scheme) } let!(:scheme_1) { FactoryBot.create(:scheme) }
let!(:scheme_2) { FactoryBot.create(:scheme) } let!(:scheme_2) { FactoryBot.create(:scheme) }

Loading…
Cancel
Save