aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2023-12-18 20:16:55 +0000
committerMatthew Lemon <y@yulqen.org>2023-12-18 20:16:55 +0000
commita0d95d9a49bc09a46e7170f3fe64510881a939d0 (patch)
tree19609d1afe1f79de85e22e282643b9e37201ffb7 /spec
parent56b8b11ff2b673005ad2044672f2eb215a905bba (diff)
Starts adding tests for organisation
Diffstat (limited to 'spec')
-rw-r--r--spec/models/organisation_spec.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/spec/models/organisation_spec.rb b/spec/models/organisation_spec.rb
index 6f6cdca..090cdc2 100644
--- a/spec/models/organisation_spec.rb
+++ b/spec/models/organisation_spec.rb
@@ -1,5 +1,16 @@
require 'rails_helper'
RSpec.describe Organisation, type: :model do
- pending "add some examples to (or delete) #{__FILE__}"
+ describe "validations" do
+ it "is invalid if no name given" do
+ org = Organisation.new()
+ expect(org).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
+ end
+ end
end