unidom-action 1.17.5 → 1.17.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f0d94ea06ef32e0fc7cb598a865f86a991a7f57e
4
- data.tar.gz: b022f30d4677b64441942ceeedeed154c30a5c3c
3
+ metadata.gz: 1d016de7719a0de88c608320a6c0ce2ba5398340
4
+ data.tar.gz: fab59826fe2ec5e3e3df236f081e872ade649110
5
5
  SHA512:
6
- metadata.gz: 3590d94114317234d35df6510c76f3f6d41556fdbf1bd36819d2c4da3e999db59483878823a9a2bd1aa78204f9781a33e6f7b55717bb828024c69f69404dd431
7
- data.tar.gz: 1a5ef60b2e06750e33b7359e82aa9a9dc2b09ed36af5a3ffd4cc61b0cc56829203940adc2fcd99d7c0db8f679586bef1685dbe89423b2c781496d2fe3bbeafbb
6
+ metadata.gz: 9c9d8c1db55ed31de21dd0f976b9b320be1d371608d8e9ec96dae2816396e7d9a77300eec5c9724f0644536852198c4563d20d6430d1b1db8dbe0224e4b3a6e0
7
+ data.tar.gz: 37043383d0ff3ff4016b158e7037b85d7a153c4017240d2c87fde601beaed5217d1be615c72a0881672a4c4b86b1ff1d460f2e06b9c5176b6e9e2409a25c3eb8
@@ -17,22 +17,8 @@ describe Unidom::Action::Reason, type: :model do
17
17
 
18
18
  it_behaves_like 'Unidom::Common::Concerns::ModelExtension', model_attributes
19
19
 
20
- it_behaves_like 'validates', model_attributes, :name,
21
- { } => 0,
22
- { name: nil } => 2,
23
- { name: '' } => 2,
24
- { name: '1' } => 1,
25
- { name: 'A' } => 1,
26
- { name: '11' } => 0,
27
- { name: 'AA' } => 0,
28
- { name: '111' } => 0,
29
- { name: 'AAA' } => 0,
30
- { name: '1'*(name_max_length-1) } => 0,
31
- { name: 'A'*(name_max_length-1) } => 0,
32
- { name: '1'*name_max_length } => 0,
33
- { name: 'A'*name_max_length } => 0,
34
- { name: '1'*(name_max_length+1) } => 1,
35
- { name: 'A'*(name_max_length+1) } => 1
20
+ it_behaves_like 'validates text', model_attributes, :name,
21
+ length: 2..described_class.columns_hash['name'].limit
36
22
 
37
23
  end
38
24
 
@@ -68,137 +68,23 @@ describe Unidom::Action::Searching, type: :model do
68
68
  { platform_name: '1'*(platform_name_max_length+1) } => 1,
69
69
  { platform_name: 'A'*(platform_name_max_length+1) } => 1
70
70
 
71
- it_behaves_like 'validates', model_attributes, :platform_version,
72
- { } => 0,
73
- { platform_version: nil } => 2,
74
- { platform_version: '' } => 2,
75
- { platform_version: '1' } => 0,
76
- { platform_version: 1 } => 0,
77
- { platform_version: 'A' } => 1,
78
- { platform_version: '1.23' } => 1,
79
- { platform_version: 1.23 } => 1,
80
- { platform_version: '-0.01' } => 1,
81
- { platform_version: -0.01 } => 1,
82
- { platform_version: '0' } => 0,
83
- { platform_version: 0 } => 0,
84
- { platform_version: '0.01' } => 1,
85
- { platform_version: 0.01 } => 1,
86
- { platform_version: '999999999' } => 0,
87
- { platform_version: 999_999_999 } => 0,
88
- { platform_version: '1000000000' } => 0,
89
- { platform_version: 1_000_000_000 } => 0,
90
- { platform_version: '1_000_000_001' } => 1,
91
- { platform_version: 1_000_000_001 } => 1
92
-
93
- it_behaves_like 'validates', model_attributes, :found_count,
94
- { } => 0,
95
- { found_count: nil } => 2,
96
- { found_count: '' } => 2,
97
- { found_count: '1' } => 0,
98
- { found_count: 1 } => 0,
99
- { found_count: 'A' } => 1,
100
- { found_count: '1.23' } => 1,
101
- { found_count: 1.23 } => 1,
102
- { found_count: '-0.01' } => 1,
103
- { found_count: -0.01 } => 1,
104
- { found_count: '0' } => 0,
105
- { found_count: 0 } => 0,
106
- { found_count: '0.01' } => 1,
107
- { found_count: 0.01 } => 1,
108
- { found_count: '999999999' } => 0,
109
- { found_count: 999_999_999 } => 0,
110
- { found_count: '1000000000' } => 0,
111
- { found_count: 1_000_000_000 } => 0,
112
- { found_count: '1_000_000_001' } => 1,
113
- { found_count: 1_000_000_001 } => 1
114
-
115
- it_behaves_like 'validates', model_attributes, :shown_count,
116
- { } => 0,
117
- { shown_count: nil } => 2,
118
- { shown_count: '' } => 2,
119
- { shown_count: '1' } => 0,
120
- { shown_count: 1 } => 0,
121
- { shown_count: 'A' } => 1,
122
- { shown_count: '1.23' } => 1,
123
- { shown_count: 1.23 } => 1,
124
- { shown_count: '-0.01' } => 1,
125
- { shown_count: -0.01 } => 1,
126
- { shown_count: '0' } => 0,
127
- { shown_count: 0 } => 0,
128
- { shown_count: '0.01' } => 1,
129
- { shown_count: 0.01 } => 1,
130
- { shown_count: '999999999' } => 0,
131
- { shown_count: 999_999_999 } => 0,
132
- { shown_count: '1000000000' } => 0,
133
- { shown_count: 1_000_000_000 } => 0,
134
- { shown_count: '1_000_000_001' } => 1,
135
- { shown_count: 1_000_000_001 } => 1
136
-
137
- it_behaves_like 'validates', model_attributes, :per_page,
138
- { } => 0,
139
- { per_page: nil } => 2,
140
- { per_page: '' } => 2,
141
- { per_page: '1' } => 0,
142
- { per_page: 1 } => 0,
143
- { per_page: 'A' } => 1,
144
- { per_page: '1.23' } => 1,
145
- { per_page: 1.23 } => 1,
146
- { per_page: '-0.01' } => 1,
147
- { per_page: -0.01 } => 1,
148
- { per_page: '0' } => 0,
149
- { per_page: 0 } => 0,
150
- { per_page: '0.01' } => 1,
151
- { per_page: 0.01 } => 1,
152
- { per_page: '999999999' } => 0,
153
- { per_page: 999_999_999 } => 0,
154
- { per_page: '1000000000' } => 0,
155
- { per_page: 1_000_000_000 } => 0,
156
- { per_page: '1_000_000_001' } => 1,
157
- { per_page: 1_000_000_001 } => 1
158
-
159
- it_behaves_like 'validates', model_attributes, :total_pages,
160
- { } => 0,
161
- { total_pages: nil } => 2,
162
- { total_pages: '' } => 2,
163
- { total_pages: '1' } => 0,
164
- { total_pages: 1 } => 0,
165
- { total_pages: 'A' } => 1,
166
- { total_pages: '1.23' } => 1,
167
- { total_pages: 1.23 } => 1,
168
- { total_pages: '-0.01' } => 1,
169
- { total_pages: -0.01 } => 1,
170
- { total_pages: '0' } => 0,
171
- { total_pages: 0 } => 0,
172
- { total_pages: '0.01' } => 1,
173
- { total_pages: 0.01 } => 1,
174
- { total_pages: '999999999' } => 0,
175
- { total_pages: 999_999_999 } => 0,
176
- { total_pages: '1000000000' } => 0,
177
- { total_pages: 1_000_000_000 } => 0,
178
- { total_pages: '1_000_000_001' } => 1,
179
- { total_pages: 1_000_000_001 } => 1
180
-
181
- it_behaves_like 'validates', model_attributes, :current_page,
182
- { } => 0,
183
- { current_page: nil } => 2,
184
- { current_page: '' } => 2,
185
- { current_page: '1' } => 0,
186
- { current_page: 1 } => 0,
187
- { current_page: 'A' } => 1,
188
- { current_page: '1.23' } => 1,
189
- { current_page: 1.23 } => 1,
190
- { current_page: '-0.01' } => 1,
191
- { current_page: -0.01 } => 1,
192
- { current_page: '0' } => 0,
193
- { current_page: 0 } => 0,
194
- { current_page: '0.01' } => 1,
195
- { current_page: 0.01 } => 1,
196
- { current_page: '999999999' } => 0,
197
- { current_page: 999_999_999 } => 0,
198
- { current_page: '1000000000' } => 0,
199
- { current_page: 1_000_000_000 } => 0,
200
- { current_page: '1_000_000_001' } => 1,
201
- { current_page: 1_000_000_001 } => 1
71
+ it_behaves_like 'validates numericality', model_attributes, :platform_version,
72
+ range: 0..1_000_000_000, minimum_inclusive: true, maximum_inclusive: true, only_integer: true
73
+
74
+ it_behaves_like 'validates numericality', model_attributes, :found_count,
75
+ range: 0..1_000_000_000, minimum_inclusive: true, maximum_inclusive: true, only_integer: true
76
+
77
+ it_behaves_like 'validates numericality', model_attributes, :shown_count,
78
+ range: 0..1_000_000_000, minimum_inclusive: true, maximum_inclusive: true, only_integer: true
79
+
80
+ it_behaves_like 'validates numericality', model_attributes, :per_page,
81
+ range: 0..1_000_000_000, minimum_inclusive: true, maximum_inclusive: true, only_integer: true
82
+
83
+ it_behaves_like 'validates numericality', model_attributes, :total_pages,
84
+ range: 0..1_000_000_000, minimum_inclusive: true, maximum_inclusive: true, only_integer: true
85
+
86
+ it_behaves_like 'validates numericality', model_attributes, :current_page,
87
+ range: 0..1_000_000_000, minimum_inclusive: true, maximum_inclusive: true, only_integer: true
202
88
 
203
89
  end
204
90
 
@@ -1,5 +1,5 @@
1
1
  module Unidom
2
2
  module Action
3
- VERSION = '1.17.5'.freeze
3
+ VERSION = '1.17.6'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unidom-action
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.17.5
4
+ version: 1.17.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Topbit Du
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-09 00:00:00.000000000 Z
11
+ date: 2017-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: unidom-common