standardapi 5.0.0.15 → 5.0.0.16

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: 33ac07bfd36c0394f555e511042e85e56ce2efe7
4
- data.tar.gz: 692696c513d7c666c4f14cf4ead1dc4d7613dbb6
3
+ metadata.gz: 6782bdd5356588527128321b446a0c5a6bdeca55
4
+ data.tar.gz: 8697b08b5b8142729f08071e436d1bea6441fe13
5
5
  SHA512:
6
- metadata.gz: e1adac840d149b4b69705cde887df45f70a7bc79e133a1078b0627a3ecb90618daeaaac13a4d11e6df5c289d68d56ed13d448f7cf5f9ba5bf2202c9e91befc1d
7
- data.tar.gz: c4356b1cab6d8c995b84661a6cf223398f596eccc05cf07b00f03f22f62703c50e96072f9705a4df901e2429b80be0f39af20be9563e472e7cdfedb9cb15a3ef
6
+ metadata.gz: b611aa8ec70e27b99ed965d97000fcc8c8eb4dfafdee5eb39eb7c31260243d92960041a91deb8760c65dde303ea6d6ea49e6d3106491582ff32896490ee3051d
7
+ data.tar.gz: 0aae715b906024759bc25e12761bc7695865da1152a62b80fdbbeafbf6f43958b716ca05666a0f5a8a9a04342217f59eee32b630faa2aef0c55b2409a406e5f3
@@ -153,44 +153,6 @@ module StandardAPI::TestCase
153
153
  raise e if e.message != "uninitialized constant #{controller_class_name}"
154
154
  end
155
155
 
156
- def include_filter_tests
157
- model.attribute_names.each do |filter|
158
- define_method("test_model_filter_#{filter}") do
159
- m = create_model
160
- value = m.send(filter)
161
-
162
- assert_predicate = -> (predicate) {
163
- get "/#{controller_class.controller_path}.json", params: { where: predicate, format: 'json' }
164
- assert_equal model.filter(predicate).order('id ASC').to_sql, assigns(plural_name).to_sql
165
- }
166
-
167
- # TODO: Test array
168
- case model.columns_hash[filter.to_s].type
169
- when :jsonb, :json # JSON
170
- assert_predicate.call({ filter => value })
171
- else
172
- case value
173
- when Array
174
- assert_predicate.call({ filter => value }) # Overlaps
175
- assert_predicate.call({ filter => value[0] }) # Contains
176
- else
177
- assert_predicate.call({ filter => value }) # Equality
178
- assert_predicate.call({ filter => { gt: value } }) # Greater Than
179
- assert_predicate.call({ filter => { greater_than: value } })
180
- assert_predicate.call({ filter => { lt: value } }) # Less Than
181
- assert_predicate.call({ filter => { less_than: value } })
182
- assert_predicate.call({ filter => { gte: value } }) # Greater Than or Equal To
183
- assert_predicate.call({ filter => { gteq: value } })
184
- assert_predicate.call({ filter => { greater_than_or_equal_to: value } })
185
- assert_predicate.call({ filter => { lte: value } }) # Less Than or Equal To
186
- assert_predicate.call({ filter => { lteq: value } })
187
- assert_predicate.call({ filter => { less_than_or_equal_to: value } })
188
- end
189
- end
190
- end
191
- end
192
- end
193
-
194
156
  def model=(val)
195
157
  @model = val
196
158
  self.filters = val.attribute_names
@@ -1,3 +1,3 @@
1
1
  module StandardAPI
2
- VERSION = '5.0.0.15'
2
+ VERSION = '5.0.0.16'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: standardapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.0.15
4
+ version: 5.0.0.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Bracy