activevalidators 1.5.1 → 1.6.0

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.
@@ -1,38 +0,0 @@
1
- require File.join(File.dirname(__FILE__), '..', 'spec_helper.rb')
2
-
3
- describe "Url Validation" do
4
- before(:each) do
5
- TestRecord.reset_callbacks(:validate)
6
- TestRecord.validates :url, :url => true
7
- end
8
-
9
- subject { TestRecord.new }
10
-
11
- it "accepts valid urls" do
12
- subject.url = 'http://www.verrot.fr'
13
- subject.should be_valid
14
- subject.should have(0).errors
15
- end
16
-
17
- it "accepts valid SSL urls" do
18
- subject.url = 'https://www.verrot.fr'
19
- subject.should be_valid
20
- subject.should have(0).errors
21
- end
22
-
23
- describe "for invalid urls" do
24
- before :each do
25
- subject.url = 'http://^^^^.fr'
26
- end
27
-
28
- it "rejects invalid urls" do
29
- subject.should_not be_valid
30
- subject.should have(1).error
31
- end
32
-
33
- it "generates an error message of type invalid" do
34
- subject.should_not be_valid
35
- subject.errors[:url].should include subject.errors.generate_message(:url, :invalid)
36
- end
37
- end
38
- end