client_side_validations-rails_2 1.0.4 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
1
  class ActiveModel::Validations::LengthValidator
2
- MESSAGES = { :is => :wrong_length, :minimum => :too_short, :maximum => :too_long }.freeze
2
+ MESSAGES = { :is => :wrong_length, :minimum => :too_short, :maximum => :too_long, :in => :wrong_length, :within => :wrong_length }.freeze
3
3
  end
4
4
 
@@ -1,6 +1,6 @@
1
1
  module ClientSideValidations
2
2
  module Rails2
3
- VERSION = '1.0.4'
3
+ VERSION = '1.0.5'
4
4
  end
5
5
  end
6
6
 
@@ -101,6 +101,23 @@ class ValidationsTest < ClientSideValidations::ActiveRecordTestBase
101
101
  assert_equal expected_hash, user.client_side_validation_hash
102
102
  end
103
103
 
104
+ def test_length_with_range_validation_to_client_side_hash
105
+ user = new_user do |p|
106
+ p.validates_length_of :name, :in => 1..3, :wrong_length=>"is the wrong length (should be within 1 and 3 characters)"
107
+ end
108
+ expected_hash = {
109
+ :name => {
110
+ :length => {
111
+ :messages => {
112
+ :in => "is the wrong length (should be within 1 and 3 characters)"
113
+ },
114
+ :in => 1..3
115
+ }
116
+ }
117
+ }
118
+ assert_equal expected_hash, user.client_side_validation_hash
119
+ end
120
+
104
121
  def test_numericality_validation_to_client_side_hash
105
122
  user = new_user do |p|
106
123
  p.validates_numericality_of :name
metadata CHANGED
@@ -1,116 +1,151 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: client_side_validations-rails_2
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.5
4
5
  prerelease:
5
- version: 1.0.4
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - Brian Cardarella
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
-
13
- date: 2011-08-06 00:00:00 -04:00
14
- default_executable:
15
- dependencies:
16
- - !ruby/object:Gem::Dependency
12
+ date: 2013-01-08 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
17
15
  name: activesupport
18
- prerelease: false
19
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
20
17
  none: false
21
- requirements:
18
+ requirements:
22
19
  - - ~>
23
- - !ruby/object:Gem::Version
20
+ - !ruby/object:Gem::Version
24
21
  version: 2.3.0
25
22
  type: :runtime
26
- version_requirements: *id001
27
- - !ruby/object:Gem::Dependency
28
- name: client_side_validations
29
23
  prerelease: false
30
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: 2.3.0
30
+ - !ruby/object:Gem::Dependency
31
+ name: client_side_validations
32
+ requirement: !ruby/object:Gem::Requirement
31
33
  none: false
32
- requirements:
34
+ requirements:
33
35
  - - ~>
34
- - !ruby/object:Gem::Version
36
+ - !ruby/object:Gem::Version
35
37
  version: 3.0.12
36
38
  type: :runtime
37
- version_requirements: *id002
38
- - !ruby/object:Gem::Dependency
39
- name: activerecord
40
39
  prerelease: false
41
- requirement: &id003 !ruby/object:Gem::Requirement
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: 3.0.12
46
+ - !ruby/object:Gem::Dependency
47
+ name: activerecord
48
+ requirement: !ruby/object:Gem::Requirement
42
49
  none: false
43
- requirements:
50
+ requirements:
44
51
  - - ~>
45
- - !ruby/object:Gem::Version
52
+ - !ruby/object:Gem::Version
46
53
  version: 2.3.0
47
54
  type: :development
48
- version_requirements: *id003
49
- - !ruby/object:Gem::Dependency
50
- name: actionpack
51
55
  prerelease: false
52
- requirement: &id004 !ruby/object:Gem::Requirement
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: 2.3.0
62
+ - !ruby/object:Gem::Dependency
63
+ name: actionpack
64
+ requirement: !ruby/object:Gem::Requirement
53
65
  none: false
54
- requirements:
66
+ requirements:
55
67
  - - ~>
56
- - !ruby/object:Gem::Version
68
+ - !ruby/object:Gem::Version
57
69
  version: 2.3.0
58
70
  type: :development
59
- version_requirements: *id004
60
- - !ruby/object:Gem::Dependency
61
- name: sqlite3
62
71
  prerelease: false
63
- requirement: &id005 !ruby/object:Gem::Requirement
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ~>
76
+ - !ruby/object:Gem::Version
77
+ version: 2.3.0
78
+ - !ruby/object:Gem::Dependency
79
+ name: sqlite3
80
+ requirement: !ruby/object:Gem::Requirement
64
81
  none: false
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: "0"
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
69
86
  type: :development
70
- version_requirements: *id005
71
- - !ruby/object:Gem::Dependency
72
- name: mocha
73
87
  prerelease: false
74
- requirement: &id006 !ruby/object:Gem::Requirement
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ - !ruby/object:Gem::Dependency
95
+ name: mocha
96
+ requirement: !ruby/object:Gem::Requirement
75
97
  none: false
76
- requirements:
77
- - - ">="
78
- - !ruby/object:Gem::Version
79
- version: "0"
98
+ requirements:
99
+ - - ! '>='
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
80
102
  type: :development
81
- version_requirements: *id006
82
- - !ruby/object:Gem::Dependency
83
- name: rack-test
84
103
  prerelease: false
85
- requirement: &id007 !ruby/object:Gem::Requirement
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ - !ruby/object:Gem::Dependency
111
+ name: rack-test
112
+ requirement: !ruby/object:Gem::Requirement
86
113
  none: false
87
- requirements:
88
- - - ">="
89
- - !ruby/object:Gem::Version
90
- version: "0"
114
+ requirements:
115
+ - - ! '>='
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
91
118
  type: :development
92
- version_requirements: *id007
93
- - !ruby/object:Gem::Dependency
94
- name: ruby-debug19
95
119
  prerelease: false
96
- requirement: &id008 !ruby/object:Gem::Requirement
120
+ version_requirements: !ruby/object:Gem::Requirement
97
121
  none: false
98
- requirements:
99
- - - ">="
100
- - !ruby/object:Gem::Version
101
- version: "0"
122
+ requirements:
123
+ - - ! '>='
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
126
+ - !ruby/object:Gem::Dependency
127
+ name: ruby-debug19
128
+ requirement: !ruby/object:Gem::Requirement
129
+ none: false
130
+ requirements:
131
+ - - ! '>='
132
+ - !ruby/object:Gem::Version
133
+ version: '0'
102
134
  type: :development
103
- version_requirements: *id008
135
+ prerelease: false
136
+ version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
138
+ requirements:
139
+ - - ! '>='
140
+ - !ruby/object:Gem::Version
141
+ version: '0'
104
142
  description: Client Side Validations support for Rails 2.x
105
- email:
143
+ email:
106
144
  - bcardarella@gmail.com
107
145
  executables: []
108
-
109
146
  extensions: []
110
-
111
147
  extra_rdoc_files: []
112
-
113
- files:
148
+ files:
114
149
  - .gitignore
115
150
  - Gemfile
116
151
  - HISTORY
@@ -147,35 +182,31 @@ files:
147
182
  - test/active_record/models/user.rb
148
183
  - test/base_helper.rb
149
184
  - test/middleware/cases/helper.rb
150
- has_rdoc: true
151
- homepage: ""
185
+ homepage: ''
152
186
  licenses: []
153
-
154
187
  post_install_message:
155
188
  rdoc_options: []
156
-
157
- require_paths:
189
+ require_paths:
158
190
  - lib
159
- required_ruby_version: !ruby/object:Gem::Requirement
191
+ required_ruby_version: !ruby/object:Gem::Requirement
160
192
  none: false
161
- requirements:
162
- - - ">="
163
- - !ruby/object:Gem::Version
164
- version: "0"
165
- required_rubygems_version: !ruby/object:Gem::Requirement
193
+ requirements:
194
+ - - ! '>='
195
+ - !ruby/object:Gem::Version
196
+ version: '0'
197
+ required_rubygems_version: !ruby/object:Gem::Requirement
166
198
  none: false
167
- requirements:
168
- - - ">="
169
- - !ruby/object:Gem::Version
170
- version: "0"
199
+ requirements:
200
+ - - ! '>='
201
+ - !ruby/object:Gem::Version
202
+ version: '0'
171
203
  requirements: []
172
-
173
204
  rubyforge_project:
174
- rubygems_version: 1.3.9.2
205
+ rubygems_version: 1.8.23
175
206
  signing_key:
176
207
  specification_version: 3
177
208
  summary: Client Side Validations support for Rails 2.x
178
- test_files:
209
+ test_files:
179
210
  - test/action_view/cases/helper.rb
180
211
  - test/action_view/cases/test_helpers.rb
181
212
  - test/action_view/cases/test_legacy_helpers.rb
@@ -191,3 +222,4 @@ test_files:
191
222
  - test/active_record/models/user.rb
192
223
  - test/base_helper.rb
193
224
  - test/middleware/cases/helper.rb
225
+ has_rdoc: