diff options
author | Matthew Lemon <y@yulqen.org> | 2023-12-20 15:24:57 +0000 |
---|---|---|
committer | Matthew Lemon <y@yulqen.org> | 2023-12-20 15:24:57 +0000 |
commit | b0c95c8066fb5753462229882a721f590453661a (patch) | |
tree | 50786eb985974f4b5bc5a1308a299cab9186f530 | |
parent | 90b5d0838b14eb2a30206b996260aae4f5049093 (diff) |
Refactors existing organisation model spec
-rw-r--r-- | spec/models/organisation_spec.rb | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/spec/models/organisation_spec.rb b/spec/models/organisation_spec.rb index 090cdc2..e21c40c 100644 --- a/spec/models/organisation_spec.rb +++ b/spec/models/organisation_spec.rb @@ -1,16 +1,18 @@ require 'rails_helper' RSpec.describe Organisation, type: :model do + + subject = Organisation.new(name: "Hollander Property") + describe "validations" do it "is invalid if no name given" do - org = Organisation.new() - expect(org).to_not be_valid + subject.name = nil + expect(subject).to_not be_valid end it "is invalid with a name longer than 25 chars" do - name = "a" * 26 - org = Organisation.new(name: name) - expect(org).to_not be_valid + subject.name = "a" * 26 + expect(subject).to_not be_valid end end end |