forest_liana 7.7.2 → 7.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/services/forest_liana/line_stat_getter.rb +1 -1
- data/app/services/forest_liana/stat_getter.rb +6 -0
- data/lib/forest_liana/bootstrapper.rb +1 -1
- data/lib/forest_liana/version.rb +1 -1
- data/spec/dummy/app/models/owner.rb +2 -0
- data/spec/dummy/config/storage.yml +4 -0
- data/spec/dummy/db/schema.rb +2 -2
- data/spec/routing/routes_spec.rb +134 -0
- data/spec/services/forest_liana/line_stat_getter_spec.rb +21 -1
- data/spec/services/forest_liana/pie_stat_getter_spec.rb +4 -4
- data/test/dummy/config/storage.yml +4 -0
- metadata +162 -158
- data/test/routing/route_test.rb +0 -142
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 82f94463ae1662d3d4eeac62d1b68b5c3a6895adfce97c87e99eb7312d8b0966
|
4
|
+
data.tar.gz: fa9f1794cde3218d3c7aa27231549493203a49876957c170fb26ee7c1b4baf73
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f30218cb8f5df0e921c754fa1d0b08f79194da46ebe7dac74bffb5343fdf8dd0797ef2542bd41d4bd240aff04821ac0bdd6bdf307375ef3c9a8d978ef07d6f9
|
7
|
+
data.tar.gz: 7192187737dfb2a67f724bb5c444072f707b3ed02f8c69dc216f4504e2e249ffebe683dff9719f405dca9960f4a44b196e1bb1ccbe021cd62bec4cc36b687621
|
@@ -86,7 +86,7 @@ module ForestLiana
|
|
86
86
|
generate_action_hooks
|
87
87
|
SchemaFileUpdater.new(SCHEMA_FILENAME, @collections_sent, @meta_sent).perform()
|
88
88
|
else
|
89
|
-
if File.
|
89
|
+
if File.exist?(SCHEMA_FILENAME)
|
90
90
|
begin
|
91
91
|
content = JSON.parse(File.read(SCHEMA_FILENAME))
|
92
92
|
@collections_sent = content['collections']
|
data/lib/forest_liana/version.rb
CHANGED
data/spec/dummy/db/schema.rb
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
# of editing this file, please use the migrations feature of Active Record to
|
3
3
|
# incrementally modify your database, and then regenerate this schema definition.
|
4
4
|
#
|
5
|
-
# This file is the source Rails uses to define your schema when running `rails
|
6
|
-
# db:schema:load`. When creating a new database, `rails db:schema:load` tends to
|
5
|
+
# This file is the source Rails uses to define your schema when running `bin/rails
|
6
|
+
# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
|
7
7
|
# be faster and is potentially less error prone than running all of your
|
8
8
|
# migrations from scratch. Old migrations may fail to apply correctly if those
|
9
9
|
# migrations use external dependencies or application code.
|
@@ -0,0 +1,134 @@
|
|
1
|
+
require 'rails_helper'
|
2
|
+
|
3
|
+
describe 'Routes' do
|
4
|
+
it 'is routed correctly' do
|
5
|
+
# Onboarding
|
6
|
+
expect(get: 'forest').to route_to(controller: 'forest_liana/apimaps', action: 'index')
|
7
|
+
|
8
|
+
# Associations
|
9
|
+
expect(
|
10
|
+
get: 'forest/:collection/:id/relationships/:association_name'
|
11
|
+
).to route_to(
|
12
|
+
controller: 'forest_liana/associations', action: 'index',
|
13
|
+
collection: ':collection', id: ':id', association_name: ':association_name'
|
14
|
+
)
|
15
|
+
expect(
|
16
|
+
get: 'forest/:collection/:id/relationships/:association_name/count'
|
17
|
+
).to route_to(
|
18
|
+
controller: 'forest_liana/associations', action: 'count',
|
19
|
+
collection: ':collection', id: ':id', association_name: ':association_name'
|
20
|
+
)
|
21
|
+
expect(
|
22
|
+
put: 'forest/:collection/:id/relationships/:association_name'
|
23
|
+
).to route_to(
|
24
|
+
controller: 'forest_liana/associations', action: 'update',
|
25
|
+
collection: ':collection', id: ':id', association_name: ':association_name'
|
26
|
+
)
|
27
|
+
expect(
|
28
|
+
post: 'forest/:collection/:id/relationships/:association_name'
|
29
|
+
).to route_to(
|
30
|
+
controller: 'forest_liana/associations', action: 'associate',
|
31
|
+
collection: ':collection', id: ':id', association_name: ':association_name'
|
32
|
+
)
|
33
|
+
expect(
|
34
|
+
delete: 'forest/:collection/:id/relationships/:association_name'
|
35
|
+
).to route_to(
|
36
|
+
controller: 'forest_liana/associations', action: 'dissociate',
|
37
|
+
collection: ':collection', id: ':id', association_name: ':association_name'
|
38
|
+
)
|
39
|
+
|
40
|
+
# Stats
|
41
|
+
expect(
|
42
|
+
post: 'forest/stats/:collection'
|
43
|
+
).to route_to(
|
44
|
+
controller: 'forest_liana/stats', action: 'get', collection: ':collection'
|
45
|
+
)
|
46
|
+
expect(
|
47
|
+
post: 'forest/stats'
|
48
|
+
).to route_to(
|
49
|
+
controller: 'forest_liana/stats', action: 'get_with_live_query'
|
50
|
+
)
|
51
|
+
|
52
|
+
# Stripe Integration
|
53
|
+
expect(
|
54
|
+
get: 'forest/(:collection)_stripe_payments'
|
55
|
+
).to route_to(
|
56
|
+
controller: 'forest_liana/stripe', action: 'payments',
|
57
|
+
collection: '(:collection)'
|
58
|
+
)
|
59
|
+
expect(
|
60
|
+
get: 'forest/:collection/:id/stripe_payments'
|
61
|
+
).to route_to(
|
62
|
+
controller: 'forest_liana/stripe', action: 'payments',
|
63
|
+
collection: ':collection', id: ':id'
|
64
|
+
)
|
65
|
+
expect(
|
66
|
+
post: 'forest/stripe_payments/refunds'
|
67
|
+
).to route_to(
|
68
|
+
controller: 'forest_liana/stripe', action: 'refund'
|
69
|
+
)
|
70
|
+
expect(
|
71
|
+
get: 'forest/(:collection)_stripe_invoices'
|
72
|
+
).to route_to(
|
73
|
+
controller: 'forest_liana/stripe', action: 'invoices',
|
74
|
+
collection: '(:collection)'
|
75
|
+
)
|
76
|
+
expect(
|
77
|
+
get: 'forest/:collection/:id/stripe_invoices'
|
78
|
+
).to route_to(
|
79
|
+
controller: 'forest_liana/stripe', action: 'invoices',
|
80
|
+
collection: ':collection', id: ':id'
|
81
|
+
)
|
82
|
+
expect(
|
83
|
+
get: 'forest/:collection/:id/stripe_cards'
|
84
|
+
).to route_to(
|
85
|
+
controller: 'forest_liana/stripe', action: 'cards',
|
86
|
+
collection: ':collection', id: ':id'
|
87
|
+
)
|
88
|
+
expect(
|
89
|
+
get: 'forest/(:collection)_stripe_subscriptions'
|
90
|
+
).to route_to(
|
91
|
+
controller: 'forest_liana/stripe', action: 'subscriptions',
|
92
|
+
collection: '(:collection)'
|
93
|
+
)
|
94
|
+
expect(
|
95
|
+
get: 'forest/:collection/:id/stripe_subscriptions'
|
96
|
+
).to route_to(
|
97
|
+
controller: 'forest_liana/stripe', action: 'subscriptions',
|
98
|
+
collection: ':collection', id: ':id'
|
99
|
+
)
|
100
|
+
expect(
|
101
|
+
get: 'forest/:collection/:id/stripe_bank_accounts'
|
102
|
+
).to route_to(
|
103
|
+
controller: 'forest_liana/stripe', action: 'bank_accounts',
|
104
|
+
collection: ':collection', id: ':id'
|
105
|
+
)
|
106
|
+
|
107
|
+
# Intercom Integration
|
108
|
+
expect(
|
109
|
+
get: 'forest/:collection/:id/intercom_conversations'
|
110
|
+
).to route_to(
|
111
|
+
controller: 'forest_liana/intercom', action: 'conversations',
|
112
|
+
collection: ':collection', id: ':id'
|
113
|
+
)
|
114
|
+
expect(
|
115
|
+
get: 'forest/:collection/:id/intercom_attributes'
|
116
|
+
).to route_to(
|
117
|
+
controller: 'forest_liana/intercom', action: 'attributes',
|
118
|
+
collection: ':collection', id: ':id'
|
119
|
+
)
|
120
|
+
expect(
|
121
|
+
get: 'forest/(*collection)_intercom_conversations/:conversation_id'
|
122
|
+
).to route_to(
|
123
|
+
controller: 'forest_liana/intercom', action: 'conversation',
|
124
|
+
collection: '(*collection)', conversation_id: ':conversation_id'
|
125
|
+
)
|
126
|
+
|
127
|
+
# Devise support
|
128
|
+
expect(
|
129
|
+
post: 'forest/actions/change-password'
|
130
|
+
).to route_to(
|
131
|
+
controller: 'forest_liana/devise', action: 'change_password'
|
132
|
+
)
|
133
|
+
end
|
134
|
+
end
|
@@ -7,6 +7,7 @@ module ForestLiana
|
|
7
7
|
before(:each) do
|
8
8
|
ForestLiana::ScopeManager.invalidate_scope_cache(rendering_id)
|
9
9
|
allow(ForestLiana::ScopeManager).to receive(:fetch_scopes).and_return(scopes)
|
10
|
+
Owner.delete_all
|
10
11
|
end
|
11
12
|
|
12
13
|
describe 'Check client_timezone function' do
|
@@ -20,8 +21,11 @@ module ForestLiana
|
|
20
21
|
end
|
21
22
|
|
22
23
|
describe 'with a non-SQLite database' do
|
24
|
+
before do
|
25
|
+
allow(ActiveRecord::Base.connection).to receive(:adapter_name).and_return('NotSQLite')
|
26
|
+
end
|
27
|
+
|
23
28
|
it 'should return the timezone' do
|
24
|
-
ActiveRecord::Base.connection.stub(:adapter_name) { 'NotSQLite' }
|
25
29
|
expect(LineStatGetter.new(Owner, {
|
26
30
|
timezone: "Europe/Paris",
|
27
31
|
aggregate: "Count",
|
@@ -54,5 +58,21 @@ module ForestLiana
|
|
54
58
|
end
|
55
59
|
end
|
56
60
|
end
|
61
|
+
|
62
|
+
describe 'Check new instance function' do
|
63
|
+
describe 'Using a Count aggregation' do
|
64
|
+
it 'should remove any order to the resource' do
|
65
|
+
Owner.create(name: 'Shuri', hired_at: Date.parse('09-11-2022'));
|
66
|
+
stat = LineStatGetter.new(Owner, {
|
67
|
+
timezone: "Europe/Paris",
|
68
|
+
aggregate: "Count",
|
69
|
+
time_range: "Day",
|
70
|
+
group_by_date_field: "hired_at",
|
71
|
+
}, user)
|
72
|
+
|
73
|
+
expect(stat.get_resource.where(name: "Shuri").to_sql.downcase.exclude? "order by").to be true
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
57
77
|
end
|
58
78
|
end
|
@@ -45,7 +45,7 @@ module ForestLiana
|
|
45
45
|
|
46
46
|
it 'should be as many categories as records count' do
|
47
47
|
subject.perform
|
48
|
-
expect(subject.record.value).to
|
48
|
+
expect(subject.record.value).to match_array([
|
49
49
|
{:key => "Old Tree n1", :value => 1},
|
50
50
|
{:key => "Old Tree n2", :value => 1},
|
51
51
|
{:key => "Old Tree n3", :value => 1},
|
@@ -55,7 +55,7 @@ module ForestLiana
|
|
55
55
|
{:key => "Young Tree n3", :value => 1},
|
56
56
|
{:key => "Young Tree n4", :value => 1},
|
57
57
|
{:key => "Young Tree n5", :value => 1}
|
58
|
-
]
|
58
|
+
])
|
59
59
|
end
|
60
60
|
end
|
61
61
|
|
@@ -91,13 +91,13 @@ module ForestLiana
|
|
91
91
|
|
92
92
|
it 'should be as many categories as records inside the scope' do
|
93
93
|
subject.perform
|
94
|
-
expect(subject.record.value).to
|
94
|
+
expect(subject.record.value).to match_array([
|
95
95
|
{:key => "Young Tree n1", :value => 1},
|
96
96
|
{:key => "Young Tree n2", :value => 1},
|
97
97
|
{:key => "Young Tree n3", :value => 1},
|
98
98
|
{:key => "Young Tree n4", :value => 1},
|
99
99
|
{:key => "Young Tree n5", :value => 1}
|
100
|
-
]
|
100
|
+
])
|
101
101
|
end
|
102
102
|
end
|
103
103
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: forest_liana
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.
|
4
|
+
version: 7.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sandro Munda
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-01-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -368,6 +368,7 @@ files:
|
|
368
368
|
- spec/dummy/config/initializers/wrap_parameters.rb
|
369
369
|
- spec/dummy/config/routes.rb
|
370
370
|
- spec/dummy/config/secrets.yml
|
371
|
+
- spec/dummy/config/storage.yml
|
371
372
|
- spec/dummy/db/migrate/20190226172951_create_user.rb
|
372
373
|
- spec/dummy/db/migrate/20190226173051_create_isle.rb
|
373
374
|
- spec/dummy/db/migrate/20190226174951_create_tree.rb
|
@@ -399,6 +400,7 @@ files:
|
|
399
400
|
- spec/requests/resources_spec.rb
|
400
401
|
- spec/requests/stats_spec.rb
|
401
402
|
- spec/requests/test.ru
|
403
|
+
- spec/routing/routes_spec.rb
|
402
404
|
- spec/services/forest_liana/apimap_sorter_spec.rb
|
403
405
|
- spec/services/forest_liana/filters_parser_spec.rb
|
404
406
|
- spec/services/forest_liana/has_many_getter_spec.rb
|
@@ -466,6 +468,7 @@ files:
|
|
466
468
|
- test/dummy/config/locales/en.yml
|
467
469
|
- test/dummy/config/routes.rb
|
468
470
|
- test/dummy/config/secrets.yml
|
471
|
+
- test/dummy/config/storage.yml
|
469
472
|
- test/dummy/db/migrate/20150608130516_create_date_field.rb
|
470
473
|
- test/dummy/db/migrate/20150608131430_create_integer_field.rb
|
471
474
|
- test/dummy/db/migrate/20150608131603_create_decimal_field.rb
|
@@ -500,7 +503,6 @@ files:
|
|
500
503
|
- test/fixtures/string_field.yml
|
501
504
|
- test/fixtures/tree.yml
|
502
505
|
- test/forest_liana_test.rb
|
503
|
-
- test/routing/route_test.rb
|
504
506
|
- test/services/forest_liana/operator_date_interval_parser_test.rb
|
505
507
|
- test/services/forest_liana/schema_adapter_test.rb
|
506
508
|
- test/test_helper.rb
|
@@ -523,193 +525,195 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
523
525
|
- !ruby/object:Gem::Version
|
524
526
|
version: '0'
|
525
527
|
requirements: []
|
526
|
-
rubygems_version: 3.
|
528
|
+
rubygems_version: 3.3.5
|
527
529
|
signing_key:
|
528
530
|
specification_version: 4
|
529
531
|
summary: Official Rails Liana for Forest
|
530
532
|
test_files:
|
531
|
-
- test/
|
532
|
-
- test/
|
533
|
-
- test/
|
534
|
-
- test/
|
535
|
-
- test/
|
536
|
-
- test/
|
537
|
-
- test/
|
538
|
-
- test/fixtures/belongs_to_field.yml
|
539
|
-
- test/fixtures/string_field.yml
|
540
|
-
- test/routing/route_test.rb
|
541
|
-
- test/test_helper.rb
|
542
|
-
- test/services/forest_liana/operator_date_interval_parser_test.rb
|
543
|
-
- test/services/forest_liana/schema_adapter_test.rb
|
544
|
-
- test/forest_liana_test.rb
|
545
|
-
- test/dummy/config/environments/test.rb
|
546
|
-
- test/dummy/config/environments/development.rb
|
547
|
-
- test/dummy/config/environments/production.rb
|
548
|
-
- test/dummy/config/environment.rb
|
549
|
-
- test/dummy/config/locales/en.yml
|
550
|
-
- test/dummy/config/routes.rb
|
551
|
-
- test/dummy/config/database.yml
|
552
|
-
- test/dummy/config/initializers/cookies_serializer.rb
|
553
|
-
- test/dummy/config/initializers/filter_parameter_logging.rb
|
554
|
-
- test/dummy/config/initializers/backtrace_silencers.rb
|
555
|
-
- test/dummy/config/initializers/inflections.rb
|
556
|
-
- test/dummy/config/initializers/wrap_parameters.rb
|
557
|
-
- test/dummy/config/initializers/mime_types.rb
|
558
|
-
- test/dummy/config/initializers/assets.rb
|
559
|
-
- test/dummy/config/initializers/session_store.rb
|
560
|
-
- test/dummy/config/application.rb
|
561
|
-
- test/dummy/config/secrets.yml
|
562
|
-
- test/dummy/config/boot.rb
|
563
|
-
- test/dummy/app/views/layouts/application.html.erb
|
564
|
-
- test/dummy/app/models/has_one_field.rb
|
565
|
-
- test/dummy/app/models/has_many_class_name_field.rb
|
533
|
+
- test/dummy/README.rdoc
|
534
|
+
- test/dummy/Rakefile
|
535
|
+
- test/dummy/app/assets/config/manifest.js
|
536
|
+
- test/dummy/app/assets/javascripts/application.js
|
537
|
+
- test/dummy/app/assets/stylesheets/application.css
|
538
|
+
- test/dummy/app/controllers/application_controller.rb
|
539
|
+
- test/dummy/app/helpers/application_helper.rb
|
566
540
|
- test/dummy/app/models/belongs_to_class_name_field.rb
|
567
|
-
- test/dummy/app/models/
|
568
|
-
- test/dummy/app/models/owner.rb
|
541
|
+
- test/dummy/app/models/belongs_to_field.rb
|
569
542
|
- test/dummy/app/models/boolean_field.rb
|
570
543
|
- test/dummy/app/models/date_field.rb
|
571
|
-
- test/dummy/app/models/
|
544
|
+
- test/dummy/app/models/decimal_field.rb
|
572
545
|
- test/dummy/app/models/float_field.rb
|
573
|
-
- test/dummy/app/models/
|
574
|
-
- test/dummy/app/models/
|
546
|
+
- test/dummy/app/models/has_and_belongs_to_many_field.rb
|
547
|
+
- test/dummy/app/models/has_many_class_name_field.rb
|
575
548
|
- test/dummy/app/models/has_many_field.rb
|
549
|
+
- test/dummy/app/models/has_many_through_field.rb
|
550
|
+
- test/dummy/app/models/has_one_field.rb
|
576
551
|
- test/dummy/app/models/integer_field.rb
|
577
|
-
- test/dummy/app/models/
|
578
|
-
- test/dummy/app/models/
|
552
|
+
- test/dummy/app/models/owner.rb
|
553
|
+
- test/dummy/app/models/polymorphic_field.rb
|
579
554
|
- test/dummy/app/models/reference.rb
|
580
|
-
- test/dummy/app/models/
|
555
|
+
- test/dummy/app/models/serialize_field.rb
|
556
|
+
- test/dummy/app/models/string_field.rb
|
581
557
|
- test/dummy/app/models/tree.rb
|
582
|
-
- test/dummy/app/
|
583
|
-
- test/dummy/
|
584
|
-
- test/dummy/
|
585
|
-
- test/dummy/
|
586
|
-
- test/dummy/
|
587
|
-
- test/dummy/
|
588
|
-
- test/dummy/
|
558
|
+
- test/dummy/app/views/layouts/application.html.erb
|
559
|
+
- test/dummy/bin/bundle
|
560
|
+
- test/dummy/bin/rails
|
561
|
+
- test/dummy/bin/rake
|
562
|
+
- test/dummy/bin/setup
|
563
|
+
- test/dummy/config/application.rb
|
564
|
+
- test/dummy/config/boot.rb
|
565
|
+
- test/dummy/config/database.yml
|
566
|
+
- test/dummy/config/environment.rb
|
567
|
+
- test/dummy/config/environments/development.rb
|
568
|
+
- test/dummy/config/environments/production.rb
|
569
|
+
- test/dummy/config/environments/test.rb
|
570
|
+
- test/dummy/config/initializers/assets.rb
|
571
|
+
- test/dummy/config/initializers/backtrace_silencers.rb
|
572
|
+
- test/dummy/config/initializers/cookies_serializer.rb
|
573
|
+
- test/dummy/config/initializers/filter_parameter_logging.rb
|
574
|
+
- test/dummy/config/initializers/inflections.rb
|
575
|
+
- test/dummy/config/initializers/mime_types.rb
|
576
|
+
- test/dummy/config/initializers/session_store.rb
|
577
|
+
- test/dummy/config/initializers/wrap_parameters.rb
|
578
|
+
- test/dummy/config/locales/en.yml
|
579
|
+
- test/dummy/config/routes.rb
|
580
|
+
- test/dummy/config/secrets.yml
|
581
|
+
- test/dummy/config/storage.yml
|
582
|
+
- test/dummy/config.ru
|
589
583
|
- test/dummy/db/migrate/20150608130516_create_date_field.rb
|
590
|
-
- test/dummy/db/migrate/
|
591
|
-
- test/dummy/db/migrate/
|
592
|
-
- test/dummy/db/migrate/20160628173505_add_timestamps.rb
|
593
|
-
- test/dummy/db/migrate/20150612112520_create_has_and_belongs_to_many_field.rb
|
594
|
-
- test/dummy/db/migrate/20150608133044_create_has_one_field.rb
|
595
|
-
- test/dummy/db/migrate/20150608150016_create_has_many_field.rb
|
596
|
-
- test/dummy/db/migrate/20160627172810_create_owner.rb
|
597
|
-
- test/dummy/db/migrate/20150608132159_create_boolean_field.rb
|
584
|
+
- test/dummy/db/migrate/20150608131430_create_integer_field.rb
|
585
|
+
- test/dummy/db/migrate/20150608131603_create_decimal_field.rb
|
598
586
|
- test/dummy/db/migrate/20150608131610_create_float_field.rb
|
587
|
+
- test/dummy/db/migrate/20150608132159_create_boolean_field.rb
|
588
|
+
- test/dummy/db/migrate/20150608132621_create_string_field.rb
|
599
589
|
- test/dummy/db/migrate/20150608133038_create_belongs_to_field.rb
|
600
|
-
- test/dummy/db/migrate/
|
590
|
+
- test/dummy/db/migrate/20150608133044_create_has_one_field.rb
|
591
|
+
- test/dummy/db/migrate/20150608150016_create_has_many_field.rb
|
592
|
+
- test/dummy/db/migrate/20150609114636_create_belongs_to_class_name_field.rb
|
593
|
+
- test/dummy/db/migrate/20150612112520_create_has_and_belongs_to_many_field.rb
|
601
594
|
- test/dummy/db/migrate/20150616150629_create_polymorphic_field.rb
|
602
595
|
- test/dummy/db/migrate/20150623115554_create_has_many_class_name_field.rb
|
603
|
-
- test/dummy/db/migrate/
|
604
|
-
- test/dummy/db/migrate/
|
605
|
-
- test/dummy/db/migrate/20150608132621_create_string_field.rb
|
596
|
+
- test/dummy/db/migrate/20150814081918_create_has_many_through_field.rb
|
597
|
+
- test/dummy/db/migrate/20160627172810_create_owner.rb
|
606
598
|
- test/dummy/db/migrate/20160627172951_create_tree.rb
|
607
|
-
- test/dummy/
|
608
|
-
- test/dummy/
|
609
|
-
- test/dummy/
|
610
|
-
- test/dummy/
|
599
|
+
- test/dummy/db/migrate/20160628173505_add_timestamps.rb
|
600
|
+
- test/dummy/db/migrate/20170614141921_create_serialize_field.rb
|
601
|
+
- test/dummy/db/migrate/20181111162121_create_references_table.rb
|
602
|
+
- test/dummy/db/schema.rb
|
611
603
|
- test/dummy/public/404.html
|
612
|
-
- test/dummy/public/500.html
|
613
604
|
- test/dummy/public/422.html
|
614
|
-
- test/dummy/
|
615
|
-
- test/dummy/
|
616
|
-
- test/
|
617
|
-
- test/
|
618
|
-
-
|
619
|
-
-
|
620
|
-
-
|
605
|
+
- test/dummy/public/500.html
|
606
|
+
- test/dummy/public/favicon.ico
|
607
|
+
- test/fixtures/belongs_to_field.yml
|
608
|
+
- test/fixtures/has_many_field.yml
|
609
|
+
- test/fixtures/has_many_through_field.yml
|
610
|
+
- test/fixtures/has_one_field.yml
|
611
|
+
- test/fixtures/owner.yml
|
612
|
+
- test/fixtures/reference.yml
|
613
|
+
- test/fixtures/serialize_field.yml
|
614
|
+
- test/fixtures/string_field.yml
|
615
|
+
- test/fixtures/tree.yml
|
616
|
+
- test/forest_liana_test.rb
|
617
|
+
- test/services/forest_liana/operator_date_interval_parser_test.rb
|
618
|
+
- test/services/forest_liana/schema_adapter_test.rb
|
619
|
+
- test/test_helper.rb
|
621
620
|
- spec/config/initializers/logger_spec.rb
|
622
|
-
- spec/
|
623
|
-
- spec/
|
624
|
-
- spec/
|
625
|
-
- spec/
|
626
|
-
- spec/
|
627
|
-
- spec/
|
628
|
-
- spec/
|
629
|
-
- spec/
|
630
|
-
- spec/helpers/
|
631
|
-
- spec/
|
632
|
-
- spec/
|
633
|
-
- spec/
|
634
|
-
- spec/
|
635
|
-
- spec/
|
636
|
-
- spec/
|
637
|
-
- spec/
|
638
|
-
- spec/
|
639
|
-
- spec/
|
640
|
-
- spec/
|
641
|
-
- spec/
|
642
|
-
- spec/
|
643
|
-
- spec/
|
644
|
-
- spec/
|
645
|
-
- spec/
|
646
|
-
- spec/
|
647
|
-
- spec/
|
648
|
-
- spec/
|
649
|
-
- spec/dummy/
|
650
|
-
- spec/dummy/
|
651
|
-
- spec/dummy/
|
652
|
-
- spec/dummy/
|
653
|
-
- spec/dummy/
|
654
|
-
- spec/dummy/config/
|
621
|
+
- spec/dummy/README.rdoc
|
622
|
+
- spec/dummy/Rakefile
|
623
|
+
- spec/dummy/app/assets/config/manifest.js
|
624
|
+
- spec/dummy/app/assets/javascripts/application.js
|
625
|
+
- spec/dummy/app/assets/stylesheets/application.css
|
626
|
+
- spec/dummy/app/config/routes.rb
|
627
|
+
- spec/dummy/app/controllers/application_controller.rb
|
628
|
+
- spec/dummy/app/controllers/forest/islands_controller.rb
|
629
|
+
- spec/dummy/app/helpers/application_helper.rb
|
630
|
+
- spec/dummy/app/models/application_record.rb
|
631
|
+
- spec/dummy/app/models/car.rb
|
632
|
+
- spec/dummy/app/models/driver.rb
|
633
|
+
- spec/dummy/app/models/garage_record.rb
|
634
|
+
- spec/dummy/app/models/island.rb
|
635
|
+
- spec/dummy/app/models/location.rb
|
636
|
+
- spec/dummy/app/models/manufacturer.rb
|
637
|
+
- spec/dummy/app/models/owner.rb
|
638
|
+
- spec/dummy/app/models/product.rb
|
639
|
+
- spec/dummy/app/models/reference.rb
|
640
|
+
- spec/dummy/app/models/sub_application_record.rb
|
641
|
+
- spec/dummy/app/models/town.rb
|
642
|
+
- spec/dummy/app/models/tree.rb
|
643
|
+
- spec/dummy/app/models/user.rb
|
644
|
+
- spec/dummy/app/models/user_record.rb
|
645
|
+
- spec/dummy/app/views/layouts/application.html.erb
|
646
|
+
- spec/dummy/bin/bundle
|
647
|
+
- spec/dummy/bin/rails
|
648
|
+
- spec/dummy/bin/rake
|
649
|
+
- spec/dummy/bin/setup
|
650
|
+
- spec/dummy/config/application.rb
|
651
|
+
- spec/dummy/config/boot.rb
|
652
|
+
- spec/dummy/config/database.yml
|
653
|
+
- spec/dummy/config/environment.rb
|
655
654
|
- spec/dummy/config/environments/development.rb
|
656
655
|
- spec/dummy/config/environments/production.rb
|
657
|
-
- spec/dummy/config/
|
658
|
-
- spec/dummy/config/
|
659
|
-
- spec/dummy/config/
|
656
|
+
- spec/dummy/config/environments/test.rb
|
657
|
+
- spec/dummy/config/initializers/assets.rb
|
658
|
+
- spec/dummy/config/initializers/backtrace_silencers.rb
|
660
659
|
- spec/dummy/config/initializers/cookies_serializer.rb
|
661
660
|
- spec/dummy/config/initializers/filter_parameter_logging.rb
|
662
|
-
- spec/dummy/config/initializers/
|
661
|
+
- spec/dummy/config/initializers/forest_liana.rb
|
663
662
|
- spec/dummy/config/initializers/inflections.rb
|
664
|
-
- spec/dummy/config/initializers/wrap_parameters.rb
|
665
663
|
- spec/dummy/config/initializers/mime_types.rb
|
666
|
-
- spec/dummy/config/initializers/forest_liana.rb
|
667
|
-
- spec/dummy/config/initializers/assets.rb
|
668
664
|
- spec/dummy/config/initializers/session_store.rb
|
669
|
-
- spec/dummy/config/
|
665
|
+
- spec/dummy/config/initializers/wrap_parameters.rb
|
666
|
+
- spec/dummy/config/routes.rb
|
670
667
|
- spec/dummy/config/secrets.yml
|
671
|
-
- spec/dummy/config/
|
672
|
-
- spec/dummy/
|
673
|
-
- spec/dummy/
|
674
|
-
- spec/dummy/
|
675
|
-
- spec/dummy/
|
676
|
-
- spec/dummy/app/models/product.rb
|
677
|
-
- spec/dummy/app/models/driver.rb
|
678
|
-
- spec/dummy/app/models/owner.rb
|
679
|
-
- spec/dummy/app/models/sub_application_record.rb
|
680
|
-
- spec/dummy/app/models/island.rb
|
681
|
-
- spec/dummy/app/models/location.rb
|
682
|
-
- spec/dummy/app/models/garage_record.rb
|
683
|
-
- spec/dummy/app/models/user_record.rb
|
684
|
-
- spec/dummy/app/models/user.rb
|
685
|
-
- spec/dummy/app/models/application_record.rb
|
686
|
-
- spec/dummy/app/models/reference.rb
|
687
|
-
- spec/dummy/app/models/manufacturer.rb
|
688
|
-
- spec/dummy/app/models/tree.rb
|
689
|
-
- spec/dummy/app/helpers/application_helper.rb
|
690
|
-
- spec/dummy/app/controllers/forest/islands_controller.rb
|
691
|
-
- spec/dummy/app/controllers/application_controller.rb
|
692
|
-
- spec/dummy/app/assets/config/manifest.js
|
693
|
-
- spec/dummy/app/assets/javascripts/application.js
|
694
|
-
- spec/dummy/app/assets/stylesheets/application.css
|
695
|
-
- spec/dummy/db/schema.rb
|
668
|
+
- spec/dummy/config/storage.yml
|
669
|
+
- spec/dummy/config.ru
|
670
|
+
- spec/dummy/db/migrate/20190226172951_create_user.rb
|
671
|
+
- spec/dummy/db/migrate/20190226173051_create_isle.rb
|
672
|
+
- spec/dummy/db/migrate/20190226174951_create_tree.rb
|
696
673
|
- spec/dummy/db/migrate/20190716130830_add_age_to_tree.rb
|
697
|
-
- spec/dummy/db/migrate/20220719094127_create_cars.rb
|
698
674
|
- spec/dummy/db/migrate/20190716135241_add_type_to_user.rb
|
699
|
-
- spec/dummy/db/migrate/20210526084712_create_products.rb
|
700
|
-
- spec/dummy/db/migrate/20220727114930_add_columns_to_products.rb
|
701
|
-
- spec/dummy/db/migrate/20210511141752_create_owners.rb
|
702
|
-
- spec/dummy/db/migrate/20190226173051_create_isle.rb
|
703
675
|
- spec/dummy/db/migrate/20210326110524_create_references.rb
|
704
676
|
- spec/dummy/db/migrate/20210326140855_create_locations.rb
|
705
|
-
- spec/dummy/db/migrate/
|
706
|
-
- spec/dummy/db/migrate/
|
677
|
+
- spec/dummy/db/migrate/20210511141752_create_owners.rb
|
678
|
+
- spec/dummy/db/migrate/20210526084712_create_products.rb
|
679
|
+
- spec/dummy/db/migrate/20220719094127_create_cars.rb
|
707
680
|
- spec/dummy/db/migrate/20220719094450_create_drivers.rb
|
708
681
|
- spec/dummy/db/migrate/20220727114450_create_manufacturers.rb
|
709
|
-
- spec/dummy/
|
710
|
-
- spec/dummy/
|
711
|
-
- spec/dummy/
|
712
|
-
- spec/dummy/
|
713
|
-
- spec/dummy/
|
714
|
-
- spec/dummy/
|
715
|
-
- spec/dummy/
|
682
|
+
- spec/dummy/db/migrate/20220727114930_add_columns_to_products.rb
|
683
|
+
- spec/dummy/db/schema.rb
|
684
|
+
- spec/dummy/lib/forest_liana/collections/island.rb
|
685
|
+
- spec/dummy/lib/forest_liana/collections/location.rb
|
686
|
+
- spec/dummy/lib/forest_liana/collections/user.rb
|
687
|
+
- spec/dummy/lib/forest_liana/controllers/owner_trees_controller.rb
|
688
|
+
- spec/dummy/lib/forest_liana/controllers/owners_controller.rb
|
689
|
+
- spec/helpers/forest_liana/query_helper_spec.rb
|
690
|
+
- spec/helpers/forest_liana/schema_helper_spec.rb
|
691
|
+
- spec/lib/forest_liana/bootstrapper_spec.rb
|
692
|
+
- spec/lib/forest_liana/schema_file_updater_spec.rb
|
693
|
+
- spec/rails_helper.rb
|
694
|
+
- spec/requests/actions_controller_spec.rb
|
695
|
+
- spec/requests/authentications_spec.rb
|
696
|
+
- spec/requests/cors_spec.rb
|
697
|
+
- spec/requests/count_spec.rb
|
698
|
+
- spec/requests/resources_spec.rb
|
699
|
+
- spec/requests/stats_spec.rb
|
700
|
+
- spec/requests/test.ru
|
701
|
+
- spec/routing/routes_spec.rb
|
702
|
+
- spec/services/forest_liana/apimap_sorter_spec.rb
|
703
|
+
- spec/services/forest_liana/filters_parser_spec.rb
|
704
|
+
- spec/services/forest_liana/has_many_getter_spec.rb
|
705
|
+
- spec/services/forest_liana/ip_whitelist_checker_spec.rb
|
706
|
+
- spec/services/forest_liana/line_stat_getter_spec.rb
|
707
|
+
- spec/services/forest_liana/permissions_checker_acl_disabled_spec.rb
|
708
|
+
- spec/services/forest_liana/permissions_checker_acl_enabled_spec.rb
|
709
|
+
- spec/services/forest_liana/permissions_checker_live_queries_spec.rb
|
710
|
+
- spec/services/forest_liana/permissions_formatter_spec.rb
|
711
|
+
- spec/services/forest_liana/permissions_getter_spec.rb
|
712
|
+
- spec/services/forest_liana/pie_stat_getter_spec.rb
|
713
|
+
- spec/services/forest_liana/resource_updater_spec.rb
|
714
|
+
- spec/services/forest_liana/resources_getter_spec.rb
|
715
|
+
- spec/services/forest_liana/schema_adapter_spec.rb
|
716
|
+
- spec/services/forest_liana/scope_manager_spec.rb
|
717
|
+
- spec/services/forest_liana/smart_action_field_validator_spec.rb
|
718
|
+
- spec/services/forest_liana/value_stat_getter_spec.rb
|
719
|
+
- spec/spec_helper.rb
|
data/test/routing/route_test.rb
DELETED
@@ -1,142 +0,0 @@
|
|
1
|
-
module ForestLiana
|
2
|
-
class RouteTest < ActiveSupport::TestCase
|
3
|
-
include ActionDispatch::Assertions::RoutingAssertions
|
4
|
-
|
5
|
-
test "Routes" do
|
6
|
-
@routes = ForestLiana::Engine.routes
|
7
|
-
|
8
|
-
# Onboarding
|
9
|
-
assert_routing({
|
10
|
-
method: 'get', path: '/'
|
11
|
-
}, {
|
12
|
-
controller: 'forest_liana/apimaps', action: 'index'
|
13
|
-
})
|
14
|
-
|
15
|
-
# Associations
|
16
|
-
assert_routing({
|
17
|
-
method: 'get', path: ':collection/:id/relationships/:association_name'
|
18
|
-
}, {
|
19
|
-
controller: 'forest_liana/associations', action: 'index',
|
20
|
-
collection: ':collection', id: ':id', association_name: ':association_name'
|
21
|
-
})
|
22
|
-
assert_routing({
|
23
|
-
method: 'get', path: ':collection/:id/relationships/:association_name/count'
|
24
|
-
}, {
|
25
|
-
controller: 'forest_liana/associations', action: 'count',
|
26
|
-
collection: ':collection', id: ':id', association_name: ':association_name'
|
27
|
-
})
|
28
|
-
assert_routing({
|
29
|
-
method: 'put', path: ':collection/:id/relationships/:association_name'
|
30
|
-
}, {
|
31
|
-
controller: 'forest_liana/associations', action: 'update',
|
32
|
-
collection: ':collection', id: ':id', association_name: ':association_name'
|
33
|
-
})
|
34
|
-
assert_routing({
|
35
|
-
method: 'post', path: ':collection/:id/relationships/:association_name'
|
36
|
-
}, {
|
37
|
-
controller: 'forest_liana/associations', action: 'associate',
|
38
|
-
collection: ':collection', id: ':id', association_name: ':association_name'
|
39
|
-
})
|
40
|
-
assert_routing({
|
41
|
-
method: 'delete', path: ':collection/:id/relationships/:association_name'
|
42
|
-
}, {
|
43
|
-
controller: 'forest_liana/associations', action: 'dissociate',
|
44
|
-
collection: ':collection', id: ':id', association_name: ':association_name'
|
45
|
-
})
|
46
|
-
|
47
|
-
# Stats
|
48
|
-
assert_routing({
|
49
|
-
method: 'post', path: '/stats/:collection'
|
50
|
-
}, {
|
51
|
-
controller: 'forest_liana/stats', action: 'get', collection: ':collection'
|
52
|
-
})
|
53
|
-
assert_routing({
|
54
|
-
method: 'post', path: '/stats'
|
55
|
-
}, {
|
56
|
-
controller: 'forest_liana/stats', action: 'get_with_live_query'
|
57
|
-
})
|
58
|
-
|
59
|
-
# Stripe Integration
|
60
|
-
assert_routing({
|
61
|
-
method: 'get', path: '(:collection)_stripe_payments'
|
62
|
-
}, {
|
63
|
-
controller: 'forest_liana/stripe', action: 'payments',
|
64
|
-
collection: '(:collection)'
|
65
|
-
})
|
66
|
-
assert_routing({
|
67
|
-
method: 'get', path: ':collection/:id/stripe_payments'
|
68
|
-
}, {
|
69
|
-
controller: 'forest_liana/stripe', action: 'payments',
|
70
|
-
collection: ':collection', id: ':id'
|
71
|
-
})
|
72
|
-
assert_routing({
|
73
|
-
method: 'post', path: 'stripe_payments/refunds'
|
74
|
-
}, {
|
75
|
-
controller: 'forest_liana/stripe', action: 'refund'
|
76
|
-
})
|
77
|
-
assert_routing({
|
78
|
-
method: 'get', path: '(:collection)_stripe_invoices'
|
79
|
-
}, {
|
80
|
-
controller: 'forest_liana/stripe', action: 'invoices',
|
81
|
-
collection: '(:collection)'
|
82
|
-
})
|
83
|
-
assert_routing({
|
84
|
-
method: 'get', path: ':collection/:id/stripe_invoices'
|
85
|
-
}, {
|
86
|
-
controller: 'forest_liana/stripe', action: 'invoices',
|
87
|
-
collection: ':collection', id: ':id'
|
88
|
-
})
|
89
|
-
assert_routing({
|
90
|
-
method: 'get', path: ':collection/:id/stripe_cards'
|
91
|
-
}, {
|
92
|
-
controller: 'forest_liana/stripe', action: 'cards',
|
93
|
-
collection: ':collection', id: ':id'
|
94
|
-
})
|
95
|
-
assert_routing({
|
96
|
-
method: 'get', path: '(:collection)_stripe_subscriptions'
|
97
|
-
}, {
|
98
|
-
controller: 'forest_liana/stripe', action: 'subscriptions',
|
99
|
-
collection: '(:collection)'
|
100
|
-
})
|
101
|
-
assert_routing({
|
102
|
-
method: 'get', path: ':collection/:id/stripe_subscriptions'
|
103
|
-
}, {
|
104
|
-
controller: 'forest_liana/stripe', action: 'subscriptions',
|
105
|
-
collection: ':collection', id: ':id'
|
106
|
-
})
|
107
|
-
assert_routing({
|
108
|
-
method: 'get', path: ':collection/:id/stripe_bank_accounts'
|
109
|
-
}, {
|
110
|
-
controller: 'forest_liana/stripe', action: 'bank_accounts',
|
111
|
-
collection: ':collection', id: ':id'
|
112
|
-
})
|
113
|
-
|
114
|
-
# Intercom Integration
|
115
|
-
assert_routing({
|
116
|
-
method: 'get', path: ':collection/:id/intercom_conversations'
|
117
|
-
}, {
|
118
|
-
controller: 'forest_liana/intercom', action: 'conversations',
|
119
|
-
collection: ':collection', id: ':id'
|
120
|
-
})
|
121
|
-
assert_routing({
|
122
|
-
method: 'get', path: ':collection/:id/intercom_attributes'
|
123
|
-
}, {
|
124
|
-
controller: 'forest_liana/intercom', action: 'attributes',
|
125
|
-
collection: ':collection', id: ':id'
|
126
|
-
})
|
127
|
-
assert_routing({
|
128
|
-
method: 'get', path: '(*collection)_intercom_conversations/:conversation_id'
|
129
|
-
}, {
|
130
|
-
controller: 'forest_liana/intercom', action: 'conversation',
|
131
|
-
collection: '(*collection)', conversation_id: ':conversation_id'
|
132
|
-
})
|
133
|
-
|
134
|
-
# Devise support
|
135
|
-
assert_routing({
|
136
|
-
method: 'post', path: '/actions/change-password'
|
137
|
-
}, {
|
138
|
-
controller: 'forest_liana/devise', action: 'change_password'
|
139
|
-
})
|
140
|
-
end
|
141
|
-
end
|
142
|
-
end
|