validators 2.5.3 → 2.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +8 -4
- data/Rakefile +9 -4
- data/data/disposable.json +1412 -23
- data/data/tld.json +391 -5
- data/lib/validators/version.rb +1 -1
- data/{spec → test}/schema.rb +0 -0
- data/{spec → test}/support/dates.rb +0 -0
- data/{spec → test}/support/emails.rb +0 -0
- data/{spec → test}/support/hostnames.rb +0 -0
- data/{spec → test}/support/ips.rb +0 -0
- data/{spec → test}/support/models.rb +0 -0
- data/{spec → test}/support/translations.yml +0 -0
- data/{spec → test}/support/urls.rb +0 -0
- data/test/test_helper.rb +41 -0
- data/test/validators/disposable_email_test.rb +23 -0
- data/test/validators/ip_test.rb +21 -0
- data/{spec/validators/validates_cnpj_format_of_spec.rb → test/validators/validates_cnpj_format_of_test.rb} +10 -10
- data/{spec/validators/validates_cpf_format_of_spec.rb → test/validators/validates_cpf_format_of_test.rb} +10 -10
- data/test/validators/validates_datetime/after_option_test.rb +75 -0
- data/test/validators/validates_datetime/before_option_test.rb +20 -0
- data/test/validators/validates_datetime/defaults_test.rb +37 -0
- data/test/validators/validates_email_format_of_test.rb +76 -0
- data/test/validators/validates_hostname_format_of/with_tld_validation_test.rb +25 -0
- data/test/validators/validates_hostname_format_of/without_tld_validation_test.rb +27 -0
- data/test/validators/validates_ip_address/ipv4_test.rb +20 -0
- data/test/validators/validates_ip_address/ipv6_test.rb +20 -0
- data/test/validators/validates_ip_address_test.rb +33 -0
- data/test/validators/validates_ownership_of_test.rb +65 -0
- data/test/validators/validates_ssh_private_key/bits_test.rb +44 -0
- data/test/validators/validates_ssh_private_key/common_test.rb +37 -0
- data/test/validators/validates_ssh_private_key/dsa_test.rb +36 -0
- data/test/validators/validates_ssh_private_key/rsa_test.rb +36 -0
- data/test/validators/validates_ssh_public_key_test.rb +37 -0
- data/test/validators/validates_url_format_of/with_tld_validation_test.rb +15 -0
- data/test/validators/validates_url_format_of/without_tld_validation_test.rb +48 -0
- data/validators.gemspec +2 -2
- metadata +65 -49
- data/.rspec +0 -1
- data/spec/spec_helper.rb +0 -38
- data/spec/validators/disposable_email_spec.rb +0 -31
- data/spec/validators/ip_spec.rb +0 -25
- data/spec/validators/validates_datetime_spec.rb +0 -125
- data/spec/validators/validates_email_format_of_spec.rb +0 -70
- data/spec/validators/validates_hostname_format_of_spec.rb +0 -53
- data/spec/validators/validates_ip_address_spec.rb +0 -59
- data/spec/validators/validates_ownership_of_spec.rb +0 -69
- data/spec/validators/validates_ssh_private_key_spec.rb +0 -152
- data/spec/validators/validates_ssh_public_key_spec.rb +0 -39
- data/spec/validators/validates_url_format_of_spec.rb +0 -65
@@ -1,70 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe ".validates_email_format_of" do
|
4
|
-
before do
|
5
|
-
User.validates_email_format_of :email, :corporate_email, :allow_blank => false
|
6
|
-
Buyer.validates_email_format_of :email, :message => "is not a valid e-mail"
|
7
|
-
Person.validates :email, :email => true
|
8
|
-
end
|
9
|
-
|
10
|
-
VALID_EMAILS.each do |email|
|
11
|
-
it "accepts #{email.inspect} as a valid email" do
|
12
|
-
user = User.new(:email => email, :corporate_email => email)
|
13
|
-
expect(user).to be_valid
|
14
|
-
|
15
|
-
user = Person.new(:email => email)
|
16
|
-
expect(user).to be_valid
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
INVALID_EMAILS.each do |email|
|
21
|
-
it "rejects #{email.inspect} as a valid email" do
|
22
|
-
user = User.new(:email => "invalid", :corporate_email => "invalid")
|
23
|
-
expect(user).not_to be_valid
|
24
|
-
|
25
|
-
user = Person.new(:email => "invalid")
|
26
|
-
expect(user).not_to be_valid
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
it "uses default error message" do
|
31
|
-
user = User.new(:email => "invalid")
|
32
|
-
expect(user).not_to be_valid
|
33
|
-
expect(user.errors[:email]).to eq(["is not a valid address"])
|
34
|
-
end
|
35
|
-
|
36
|
-
it "rejects nil value" do
|
37
|
-
user = User.new(:email => nil)
|
38
|
-
expect(user).not_to be_valid
|
39
|
-
expect(user.errors[:email]).not_to be_empty
|
40
|
-
end
|
41
|
-
|
42
|
-
it "rejects empty value" do
|
43
|
-
user = User.new(:email => "")
|
44
|
-
expect(user).not_to be_valid
|
45
|
-
expect(user.errors[:email]).not_to be_empty
|
46
|
-
end
|
47
|
-
|
48
|
-
it "validates multiple attributes" do
|
49
|
-
user = User.new(:corporate_email => "invalid")
|
50
|
-
expect(user).not_to be_valid
|
51
|
-
expect(user.errors[:corporate_email]).to eq(["is not a valid address"])
|
52
|
-
end
|
53
|
-
|
54
|
-
it "uses custom error message as :message options" do
|
55
|
-
buyer = Buyer.new(:email => "invalid")
|
56
|
-
expect(buyer).not_to be_valid
|
57
|
-
expect(buyer.errors[:email]).to eq(["is not a valid e-mail"])
|
58
|
-
end
|
59
|
-
|
60
|
-
it "uses I18n string as error message [pt-BR]" do
|
61
|
-
I18n.locale = :'pt-BR'
|
62
|
-
user = User.new(:email => "invalid")
|
63
|
-
expect(user).not_to be_valid
|
64
|
-
expect(user.errors[:email]).to eq(["não parece ser um e-mail válido"])
|
65
|
-
end
|
66
|
-
|
67
|
-
it "defines alias method" do
|
68
|
-
expect(User).to respond_to(:validates_email)
|
69
|
-
end
|
70
|
-
end
|
@@ -1,53 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe ".validates_hostname_format_of" do
|
4
|
-
context "with TLD validation" do
|
5
|
-
it 'rejects invalid TLD' do
|
6
|
-
server = ServerWithTLD.new('example.xy')
|
7
|
-
expect(server).not_to be_valid
|
8
|
-
end
|
9
|
-
|
10
|
-
it 'rejects only host label' do
|
11
|
-
server = ServerWithTLD.new('com')
|
12
|
-
expect(server).not_to be_valid
|
13
|
-
end
|
14
|
-
|
15
|
-
TLDs.each do |tld|
|
16
|
-
it "accepts #{tld} as TLD" do
|
17
|
-
server = ServerWithTLD.new("example.#{tld}")
|
18
|
-
expect(server).to be_valid
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
it "accepts example.com.br" do
|
23
|
-
server = ServerWithTLD.new("example.com.br")
|
24
|
-
expect(server).to be_valid
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
context "without TLD validation" do
|
29
|
-
VALID_HOSTNAMES.each do |host|
|
30
|
-
it "accepts #{host}" do
|
31
|
-
server = ServerWithoutTLD.new(host)
|
32
|
-
expect(server).to be_valid
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
INVALID_HOSTNAMES.each do |host|
|
37
|
-
it "rejects #{host}" do
|
38
|
-
server = ServerWithoutTLD.new(host)
|
39
|
-
expect(server).not_to be_valid
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
it 'rejects nil hostname' do
|
44
|
-
server = ServerWithoutTLD.new(nil)
|
45
|
-
expect(server).not_to be_valid
|
46
|
-
end
|
47
|
-
|
48
|
-
it 'rejects blank hostname' do
|
49
|
-
server = ServerWithoutTLD.new('')
|
50
|
-
expect(server).not_to be_valid
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
@@ -1,59 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe ".validates_ip_address" do
|
4
|
-
subject { User.new }
|
5
|
-
|
6
|
-
context "IPv4" do
|
7
|
-
it "is valid" do
|
8
|
-
User.validates_ip_address :url, :only => :v4
|
9
|
-
subject.url = "192.168.1.2"
|
10
|
-
expect(subject).to be_valid
|
11
|
-
end
|
12
|
-
|
13
|
-
it "is invalid" do
|
14
|
-
User.validates_ip_address :url, :only => :v4
|
15
|
-
subject.url = "FE80:0000:0000:0000:0202:B3FF:FE1E:8329"
|
16
|
-
expect(subject).not_to be_valid
|
17
|
-
expect(subject.errors[:url]).to eq(["is not a valid IPv4 address"])
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
context "IPv6" do
|
22
|
-
it "is valid" do
|
23
|
-
User.validates_ip_address :url, :only => :v6
|
24
|
-
subject.url = "FE80:0000:0000:0000:0202:B3FF:FE1E:8329"
|
25
|
-
expect(subject).to be_valid
|
26
|
-
end
|
27
|
-
|
28
|
-
it "is invalid" do
|
29
|
-
User.validates_ip_address :url, :only => :v6
|
30
|
-
subject.url = "192.168.1.2"
|
31
|
-
expect(subject).not_to be_valid
|
32
|
-
expect(subject.errors[:url]).to eq(["is not a valid IPv6 address"])
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
it "is valid with IPv4" do
|
37
|
-
User.validates_ip_address :url
|
38
|
-
subject.url = "192.168.1.2"
|
39
|
-
expect(subject).to be_valid
|
40
|
-
end
|
41
|
-
|
42
|
-
it "is valid with IPv6" do
|
43
|
-
User.validates_ip_address :url
|
44
|
-
subject.url = "FE80:0000:0000:0000:0202:B3FF:FE1E:8329"
|
45
|
-
expect(subject).to be_valid
|
46
|
-
end
|
47
|
-
|
48
|
-
it "allows blank values" do
|
49
|
-
User.validates_ip_address :url, :allow_blank => true
|
50
|
-
subject.url = ""
|
51
|
-
expect(subject).to be_valid
|
52
|
-
end
|
53
|
-
|
54
|
-
it "allows nil values" do
|
55
|
-
User.validates_ip_address :url, :allow_nil => true
|
56
|
-
subject.url = nil
|
57
|
-
expect(subject).to be_valid
|
58
|
-
end
|
59
|
-
end
|
@@ -1,69 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe ".validates_ownership_of" do
|
4
|
-
let!(:user) { User.create! }
|
5
|
-
let!(:another_user) { User.create! }
|
6
|
-
let!(:category) { Category.create!(:user => user) }
|
7
|
-
let!(:another_category) { Category.create!(:user => another_user) }
|
8
|
-
subject { Task.new(:user => user, :category => category) }
|
9
|
-
|
10
|
-
before do
|
11
|
-
Task.validates_ownership_of :category, :with => :user
|
12
|
-
end
|
13
|
-
|
14
|
-
it "is valid when record is owned by the correct user" do
|
15
|
-
expect(subject).to be_valid
|
16
|
-
end
|
17
|
-
|
18
|
-
it "is invalid when record is owned by a different user" do
|
19
|
-
subject.category = another_category
|
20
|
-
expect(subject).not_to be_valid
|
21
|
-
end
|
22
|
-
|
23
|
-
it "raises error without :with option" do
|
24
|
-
expect {
|
25
|
-
Task.validates_ownership_of :category
|
26
|
-
}.to raise_error(ArgumentError)
|
27
|
-
end
|
28
|
-
|
29
|
-
it "raises error when :with options is not a valid type" do
|
30
|
-
expect {
|
31
|
-
Task.validates_ownership_of :category, :with => user
|
32
|
-
}.to raise_error(ArgumentError)
|
33
|
-
end
|
34
|
-
|
35
|
-
it "is invalid when owner is not present" do
|
36
|
-
expect {
|
37
|
-
subject.user = nil
|
38
|
-
expect(subject).not_to be_valid
|
39
|
-
}.to_not raise_error
|
40
|
-
end
|
41
|
-
|
42
|
-
it "is invalid when attribute owner is not present" do
|
43
|
-
expect {
|
44
|
-
subject.category.user = nil
|
45
|
-
expect(subject).not_to be_valid
|
46
|
-
}.to_not raise_error
|
47
|
-
end
|
48
|
-
|
49
|
-
it "is valid when both owners are nil" do
|
50
|
-
expect {
|
51
|
-
subject.category.user = nil
|
52
|
-
subject.user = nil
|
53
|
-
expect(subject).to be_valid
|
54
|
-
}.to_not raise_error
|
55
|
-
end
|
56
|
-
|
57
|
-
it "is valid when attribute is nil" do
|
58
|
-
expect {
|
59
|
-
subject.category = nil
|
60
|
-
expect(subject).to be_valid
|
61
|
-
}.to_not raise_error
|
62
|
-
end
|
63
|
-
|
64
|
-
it "sets error message" do
|
65
|
-
subject.user = nil
|
66
|
-
expect(subject).not_to be_valid
|
67
|
-
expect(subject.errors[:category]).to eq(["is not associated with your user"])
|
68
|
-
end
|
69
|
-
end
|
@@ -1,152 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe ".validates_ssh_private_key" do
|
4
|
-
context "common" do
|
5
|
-
let(:model) { Class.new {
|
6
|
-
def self.name
|
7
|
-
"User"
|
8
|
-
end
|
9
|
-
|
10
|
-
include ActiveModel::Model
|
11
|
-
validates_ssh_private_key :key
|
12
|
-
attr_accessor :key
|
13
|
-
} }
|
14
|
-
|
15
|
-
it "requires valid key" do
|
16
|
-
record = model.new(key: "invalid")
|
17
|
-
record.valid?
|
18
|
-
|
19
|
-
expect(record.errors[:key]).not_to be_empty
|
20
|
-
end
|
21
|
-
|
22
|
-
it "accepts valid key" do
|
23
|
-
record = model.new(key: SSHKey.generate.private_key)
|
24
|
-
record.valid?
|
25
|
-
|
26
|
-
expect(record.errors[:key]).to be_empty
|
27
|
-
end
|
28
|
-
|
29
|
-
it "sets translated error message" do
|
30
|
-
I18n.locale = "pt-BR"
|
31
|
-
message = "não é uma chave privada de SSH válida"
|
32
|
-
|
33
|
-
record = model.new(key: "invalid")
|
34
|
-
record.valid?
|
35
|
-
|
36
|
-
expect(record.errors[:key]).to include(message)
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
context "type validation (RSA)" do
|
41
|
-
let(:model) { Class.new {
|
42
|
-
def self.name
|
43
|
-
"User"
|
44
|
-
end
|
45
|
-
|
46
|
-
include ActiveModel::Model
|
47
|
-
validates_ssh_private_key :key, type: 'rsa'
|
48
|
-
attr_accessor :key
|
49
|
-
} }
|
50
|
-
|
51
|
-
it "accepts rsa key" do
|
52
|
-
record = model.new(key: SSHKey.generate(type: "rsa").private_key)
|
53
|
-
record.valid?
|
54
|
-
|
55
|
-
expect(record.errors[:key]).to be_empty
|
56
|
-
end
|
57
|
-
|
58
|
-
it "rejects dsa key" do
|
59
|
-
record = model.new(key: SSHKey.generate(type: "dsa").private_key)
|
60
|
-
record.valid?
|
61
|
-
|
62
|
-
expect(record.errors[:key]).not_to be_empty
|
63
|
-
end
|
64
|
-
|
65
|
-
it "sets translated error message" do
|
66
|
-
I18n.locale = "pt-BR"
|
67
|
-
|
68
|
-
record = model.new(key: SSHKey.generate(type: "dsa").private_key)
|
69
|
-
record.valid?
|
70
|
-
|
71
|
-
expect(record.errors[:key]).to include("precisa ser uma chave RSA")
|
72
|
-
end
|
73
|
-
end
|
74
|
-
|
75
|
-
context "type validation (DSA)" do
|
76
|
-
let(:model) { Class.new {
|
77
|
-
def self.name
|
78
|
-
"User"
|
79
|
-
end
|
80
|
-
|
81
|
-
include ActiveModel::Model
|
82
|
-
validates_ssh_private_key :key, type: "dsa"
|
83
|
-
attr_accessor :key
|
84
|
-
} }
|
85
|
-
|
86
|
-
it "accepts dsa key" do
|
87
|
-
record = model.new(key: SSHKey.generate(type: "dsa").private_key)
|
88
|
-
record.valid?
|
89
|
-
|
90
|
-
expect(record.errors[:key]).to be_empty
|
91
|
-
end
|
92
|
-
|
93
|
-
it "rejects rsa key" do
|
94
|
-
record = model.new(key: SSHKey.generate(type: 'rsa').private_key)
|
95
|
-
record.valid?
|
96
|
-
|
97
|
-
expect(record.errors[:key]).not_to be_empty
|
98
|
-
end
|
99
|
-
|
100
|
-
it "sets translated error message" do
|
101
|
-
I18n.locale = "pt-BR"
|
102
|
-
|
103
|
-
record = model.new(key: SSHKey.generate(type: 'rsa').private_key)
|
104
|
-
record.valid?
|
105
|
-
|
106
|
-
expect(record.errors[:key]).to include("precisa ser uma chave DSA")
|
107
|
-
end
|
108
|
-
end
|
109
|
-
|
110
|
-
context "bits" do
|
111
|
-
let(:model) { Class.new {
|
112
|
-
def self.name
|
113
|
-
"User"
|
114
|
-
end
|
115
|
-
|
116
|
-
include ActiveModel::Model
|
117
|
-
validates_ssh_private_key :key, bits: 2048
|
118
|
-
attr_accessor :key
|
119
|
-
} }
|
120
|
-
|
121
|
-
it "accepts bits equals to required" do
|
122
|
-
record = model.new(key: SSHKey.generate(bits: 2048).private_key)
|
123
|
-
record.valid?
|
124
|
-
|
125
|
-
expect(record.errors[:key]).to be_empty
|
126
|
-
end
|
127
|
-
|
128
|
-
it "accepts bits greater than required" do
|
129
|
-
record = model.new(key: SSHKey.generate(bits: 4096).private_key)
|
130
|
-
record.valid?
|
131
|
-
|
132
|
-
expect(record.errors[:key]).to be_empty
|
133
|
-
end
|
134
|
-
|
135
|
-
it "rejects invalid bits" do
|
136
|
-
record = model.new(key: SSHKey.generate(bits: 1024).private_key)
|
137
|
-
record.valid?
|
138
|
-
|
139
|
-
expect(record.errors[:key]).not_to be_empty
|
140
|
-
end
|
141
|
-
|
142
|
-
it "sets translated error message" do
|
143
|
-
I18n.locale = "pt-BR"
|
144
|
-
message = "precisa ter pelo menos 2048 bits; a sua chave tem 1024 bits"
|
145
|
-
|
146
|
-
record = model.new(key: SSHKey.generate(bits: 1024).private_key)
|
147
|
-
record.valid?
|
148
|
-
|
149
|
-
expect(record.errors[:key]).to include(message)
|
150
|
-
end
|
151
|
-
end
|
152
|
-
end
|
@@ -1,39 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe ".validates_ssh_public_key" do
|
4
|
-
context "common" do
|
5
|
-
let(:model) { Class.new {
|
6
|
-
def self.name
|
7
|
-
"User"
|
8
|
-
end
|
9
|
-
|
10
|
-
include ActiveModel::Model
|
11
|
-
validates_ssh_public_key :key
|
12
|
-
attr_accessor :key
|
13
|
-
} }
|
14
|
-
|
15
|
-
it "requires valid key" do
|
16
|
-
record = model.new(key: nil)
|
17
|
-
record.valid?
|
18
|
-
|
19
|
-
expect(record.errors[:key]).not_to be_empty
|
20
|
-
end
|
21
|
-
|
22
|
-
it "accepts valid key" do
|
23
|
-
record = model.new(key: SSHKey.generate.ssh_public_key)
|
24
|
-
record.valid?
|
25
|
-
|
26
|
-
expect(record.errors[:key]).to be_empty
|
27
|
-
end
|
28
|
-
|
29
|
-
it "sets translated error message" do
|
30
|
-
I18n.locale = "pt-BR"
|
31
|
-
message = "não é uma chave pública de SSH válida"
|
32
|
-
|
33
|
-
record = model.new(key: "invalid")
|
34
|
-
record.valid?
|
35
|
-
|
36
|
-
expect(record.errors[:key]).to include(message)
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
@@ -1,65 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
require "spec_helper"
|
3
|
-
|
4
|
-
describe ".validates_url_format_of" do
|
5
|
-
context "validating TLD" do
|
6
|
-
it "rejects invalid TLD" do
|
7
|
-
user = UserWithTLD.new('http://example.xy')
|
8
|
-
expect(user).not_to be_valid
|
9
|
-
end
|
10
|
-
|
11
|
-
TLDs.each do |tld|
|
12
|
-
it "accepts #{tld} as TLD" do
|
13
|
-
user = UserWithTLD.new("http://example.#{tld}")
|
14
|
-
expect(user).to be_valid
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
context "without validating TLD" do
|
20
|
-
before do
|
21
|
-
User.validates_url_format_of :url, :allow_blank => false
|
22
|
-
end
|
23
|
-
|
24
|
-
VALID_URLS.each do |url|
|
25
|
-
it "accepts #{url.inspect} as a valid url" do
|
26
|
-
user = User.new(:url => url)
|
27
|
-
expect(user).to be_valid
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
INVALID_URLS.each do |url|
|
32
|
-
it "rejects #{url.inspect} as a valid url" do
|
33
|
-
user = User.new(:url => url)
|
34
|
-
expect(user).not_to be_valid
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
it "defines alias method" do
|
39
|
-
expect(User).to respond_to(:validates_url)
|
40
|
-
end
|
41
|
-
|
42
|
-
it "uses default error message" do
|
43
|
-
user = User.new(:url => "invalid")
|
44
|
-
expect(user).not_to be_valid
|
45
|
-
expect(user.errors[:url]).to eq(["is not a valid address"])
|
46
|
-
end
|
47
|
-
|
48
|
-
it "uses I18n string as error message [pt-BR]" do
|
49
|
-
I18n.locale = :'pt-BR'
|
50
|
-
user = User.new(:url => "invalid")
|
51
|
-
expect(user).not_to be_valid
|
52
|
-
expect(user.errors[:url]).to eq(["não parece ser uma URL válida"])
|
53
|
-
end
|
54
|
-
|
55
|
-
it "rejects nil urls" do
|
56
|
-
user = User.new(url: nil)
|
57
|
-
expect(user).not_to be_valid
|
58
|
-
end
|
59
|
-
|
60
|
-
it "rejects blank urls" do
|
61
|
-
user = User.new(url: '')
|
62
|
-
expect(user).not_to be_valid
|
63
|
-
end
|
64
|
-
end
|
65
|
-
end
|