foreman-tasks 0.15.9 → 0.15.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c59c8e933514a6d3ca2f5f0cfa17da2335c24d1821aa9a9d96c8abcf0a935fe7
|
4
|
+
data.tar.gz: 3d7b88cdd625b8ac450b5f36dec1de26374c8a2b265e49c779e581ffc93cef48
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: acd6a37cd6260beece7fc8729b6aa91d40c4b9fff1c8f64620a84ca67cf528e7dcefffc132e010076da9d8083f4da4863753a1eb1b9eaaa10bc8f60d18655d2a
|
7
|
+
data.tar.gz: 4e7aa88a764c0716b28396479cc9c82fdfbf9c00ec4f66576bff55ebc42a630c9814ee7a8528d399c56b10ce297ea662e861cf836a97f5be52bc3d3fd44cd89e
|
@@ -16,7 +16,8 @@ module ForemanTasks
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def summary
|
19
|
-
|
19
|
+
scope = resource_base.search_for(current_taxonomy_search).select(:id)
|
20
|
+
render json: Task::Summarizer.new(Task.where(:id => scope), params[:recent_timeframe].to_i).summary
|
20
21
|
end
|
21
22
|
|
22
23
|
def sub_tasks
|
@@ -41,6 +41,41 @@ module ForemanTasks
|
|
41
41
|
response = JSON.parse(@response.body)
|
42
42
|
assert_equal 0, response['stopped']['total']
|
43
43
|
end
|
44
|
+
|
45
|
+
describe 'taxonomy scoping' do
|
46
|
+
before do
|
47
|
+
@organizations = [0, 0].map { FactoryBot.create(:organization) }
|
48
|
+
@locations = [0, 0].map { FactoryBot.create(:location) }
|
49
|
+
@tasks = [0, 0].map { FactoryBot.create(:some_task) }
|
50
|
+
@tasks.zip(@organizations, @locations).each do |task, org, loc|
|
51
|
+
Lock.link!(org, task.id)
|
52
|
+
Lock.link!(loc, task.id)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
it 'does not limit if unset' do
|
57
|
+
get(:summary, params: { recent_timeframe: 24 }, session: set_session_user)
|
58
|
+
assert_response :success
|
59
|
+
response = JSON.parse(@response.body)
|
60
|
+
assert_equal 2, response['stopped']['total']
|
61
|
+
end
|
62
|
+
|
63
|
+
it 'finds only tasks with matching taxonomies' do
|
64
|
+
get(:summary, params: { recent_timeframe: 24 },
|
65
|
+
session: set_session_user.merge(:organization_id => @organizations.first, :location_id => @locations.first))
|
66
|
+
assert_response :success
|
67
|
+
response = JSON.parse(@response.body)
|
68
|
+
assert_equal 1, response['stopped']['total']
|
69
|
+
end
|
70
|
+
|
71
|
+
it 'find no tasks when taxonomy combination contains no tasks' do
|
72
|
+
get(:summary, params: { recent_timeframe: 24 },
|
73
|
+
session: set_session_user.merge(:organization_id => @organizations.first, :location_id => @locations.last))
|
74
|
+
assert_response :success
|
75
|
+
response = JSON.parse(@response.body)
|
76
|
+
assert_equal 0, response['stopped']['total']
|
77
|
+
end
|
78
|
+
end
|
44
79
|
end
|
45
80
|
|
46
81
|
it 'supports csv export' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman-tasks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.15.
|
4
|
+
version: 0.15.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ivan Nečas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-09-
|
11
|
+
date: 2019-09-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: foreman-tasks-core
|