diff options
author | Noah Leal <noahleal@me.com> | 2020-06-11 17:18:17 +0300 |
---|---|---|
committer | Dennis Schubert <mail@dennis-schubert.de> | 2020-06-14 00:31:03 +0300 |
commit | ad91dddd6319f837d06881d8ef2c20a9722354e6 (patch) | |
tree | 43d7a1512d850c8c3be8d95e31324c0fbdf8ed62 /spec | |
parent | 7193099902486429b4fcbbb567bbca2f3cbef6d4 (diff) |
Issue #8119 - Add length validation to a profile's gender field.
closes #8127
Diffstat (limited to 'spec')
-rw-r--r-- | spec/models/profile_spec.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/models/profile_spec.rb b/spec/models/profile_spec.rb index c1a83f13f..f0cafecf1 100644 --- a/spec/models/profile_spec.rb +++ b/spec/models/profile_spec.rb @@ -124,6 +124,18 @@ describe Profile, :type => :model do end end + describe "of gender" do + it "can be 255 characters long" do + profile = FactoryGirl.build(:profile, gender: "a" * 255) + expect(profile).to be_valid + end + + it "cannot be 256 characters" do + profile = FactoryGirl.build(:profile, gender: "a" * 256) + expect(profile).not_to be_valid + end + end + describe "image_url setters" do %i(image_url image_url_small image_url_medium).each do |method| describe "##{method}=" do |