standardapi 6.0.0.11 → 6.0.0.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/standard_api/test_case/calculate_tests.rb +5 -2
- data/lib/standard_api/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dea6fe2070a9d9f2e92b545da5d2f7415568fee783ba45e1be6628822eb49fa7
|
4
|
+
data.tar.gz: a4b14c21227e9790fe4913b173faadc310b7384d09c39cd1891b864fd98c2ff6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 451fbdbd66417b109b33d4bc1631f7a9e2913e345b966074baad332168c4184f5d8c7cda94f4e48afb771ef22bd4eb7d9b38986bbd1bd874ceef251001aeddc9
|
7
|
+
data.tar.gz: cd109f69f5115e62a66719b1310af3d28a71ce7124d4cc873c139d44b59680edac0ff6330f935a9b1d2ddca2919d18a89fa7d7718d323689bffbed3ec3f04837
|
@@ -3,9 +3,12 @@ module StandardAPI
|
|
3
3
|
module CalculateTests
|
4
4
|
extend ActiveSupport::Testing::Declarative
|
5
5
|
|
6
|
+
CALCULATE_COLUMN_TYPES = ["smallint", "int", "bigint", "real", "double precision", "numeric", "interval"]
|
7
|
+
|
6
8
|
test '#calculate.json' do
|
7
9
|
create_model
|
8
|
-
|
10
|
+
|
11
|
+
column = model.columns.find { |x| CALCULATE_COLUMN_TYPES.include?(x.sql_type) }.name
|
9
12
|
selects = [{ count: column}, { maximum: column }, { minimum: column }, { average: column }]
|
10
13
|
|
11
14
|
get resource_path(:calculate, select: selects, format: :json)
|
@@ -18,7 +21,7 @@ module StandardAPI
|
|
18
21
|
m1 = create_model
|
19
22
|
create_model
|
20
23
|
|
21
|
-
column = model.columns.find { |x|
|
24
|
+
column = model.columns.find { |x| CALCULATE_COLUMN_TYPES.include?(x.sql_type) }.name
|
22
25
|
selects = [{ count: column}, { maximum: column }, { minimum: column }, { average: column }]
|
23
26
|
predicate = { id: { gt: m1.id } }
|
24
27
|
|
data/lib/standard_api/version.rb
CHANGED