standardapi 6.0.0.14 → 6.0.0.15
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 +8 -11
- 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: bbc6b3f7345e1df82060abcc37ee0bcf5f11b88863e1cdab4299f514129b44f6
|
4
|
+
data.tar.gz: cae2c3d6859933c99ac13f0704e35997e3c10603f53d325b3a8ace63607fce94
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 75a1555b14bbbcfd99f2dcd31cbba472a157c0066a22d597cd1fff9daa7c4f53e1c6461c21c8adde888715a90df07ae7e4e8eb48467b702a7ba45e6dba21de10
|
7
|
+
data.tar.gz: a9deedd375a788e22502b4caea542fdbe935ac6f4d594d8e46ceb79bcf9202e5813b795df9c60c7360ef84a9068b5388d862e95734e9bd05f427f4286ff3d114
|
@@ -15,16 +15,17 @@ module StandardAPI
|
|
15
15
|
|
16
16
|
if math_column
|
17
17
|
column = math_column
|
18
|
-
selects = [{ count: column.name}, { maximum: column.name }, { minimum: column.name }, { average: column.name }]
|
18
|
+
selects = [{ count: column.name }, { maximum: column.name }, { minimum: column.name }, { average: column.name }]
|
19
19
|
else
|
20
20
|
column = model.columns.sample
|
21
|
-
selects = [{ count: column.name}]
|
21
|
+
selects = [{ count: column.name }]
|
22
22
|
end
|
23
23
|
|
24
24
|
get resource_path(:calculate, select: selects, format: :json)
|
25
25
|
assert_response :ok
|
26
26
|
calculations = @controller.instance_variable_get('@calculations')
|
27
|
-
assert_equal [
|
27
|
+
assert_equal [selects.map { |s| model.send(s.keys.first, column.name) }],
|
28
|
+
calculations
|
28
29
|
end
|
29
30
|
|
30
31
|
test '#calculate.json params[:where]' do
|
@@ -44,14 +45,10 @@ module StandardAPI
|
|
44
45
|
predicate = { id: { gt: m1.id } }
|
45
46
|
|
46
47
|
get resource_path(:calculate, where: predicate, select: selects, format: :json)
|
47
|
-
|
48
|
-
|
49
|
-
# assert_equal [
|
50
|
-
#
|
51
|
-
# model.filter(predicate).maximum(column),
|
52
|
-
# model.filter(predicate).minimum(column),
|
53
|
-
# model.filter(predicate).average(column).to_f
|
54
|
-
# ]], @controller.instance_variable_get('@calculations')
|
48
|
+
assert_response :ok
|
49
|
+
calculations = @controller.instance_variable_get('@calculations')
|
50
|
+
# assert_equal [selects.map { |s| model.send(s.keys.first, column.name) }],
|
51
|
+
# calculations
|
55
52
|
end
|
56
53
|
|
57
54
|
test '#calculate.json mask' do
|
data/lib/standard_api/version.rb
CHANGED