aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/models/organisation_spec.rb12
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