forest_liana 7.7.3 → 7.8.0

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: e8c6c5a8b5b33ac56a02d5b3a25b8d02e30789da233e7449d32a0b2675802f32
4
- data.tar.gz: b5d2d9b22e74c1a55e20a84b2f6fb2975837d2413dbb520d772211595d6215e2
3
+ metadata.gz: 82f94463ae1662d3d4eeac62d1b68b5c3a6895adfce97c87e99eb7312d8b0966
4
+ data.tar.gz: fa9f1794cde3218d3c7aa27231549493203a49876957c170fb26ee7c1b4baf73
5
5
  SHA512:
6
- metadata.gz: 68c3af37427709c5b5292d122694f5ae8999262f37ba5f8ebb6cdf8873c1f6bafb543b4be45d14ab707d2913afab270c9a16910ca6528394fb5ac74c8098792d
7
- data.tar.gz: a41c9d7e1e9504404b127a139b5f2a9bbf8cc7f7727b646c10ee66b7045fb58ac2639a5c5b1efc75f066b58126ff66085f9cc8f4cd98ef956c718335d85b36cb
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.exists?(SCHEMA_FILENAME)
89
+ if File.exist?(SCHEMA_FILENAME)
90
90
  begin
91
91
  content = JSON.parse(File.read(SCHEMA_FILENAME))
92
92
  @collections_sent = content['collections']
@@ -1,3 +1,3 @@
1
1
  module ForestLiana
2
- VERSION = "7.7.3"
2
+ VERSION = "7.8.0"
3
3
  end
@@ -0,0 +1,4 @@
1
+ ---
2
+ local:
3
+ service: Disk
4
+ root: <%= Rails.root.join("storage") %>
@@ -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
@@ -21,8 +21,11 @@ module ForestLiana
21
21
  end
22
22
 
23
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
+
24
28
  it 'should return the timezone' do
25
- ActiveRecord::Base.connection.stub(:adapter_name) { 'NotSQLite' }
26
29
  expect(LineStatGetter.new(Owner, {
27
30
  timezone: "Europe/Paris",
28
31
  aggregate: "Count",
@@ -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 eq [
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 eq [
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
 
@@ -0,0 +1,4 @@
1
+ ---
2
+ local:
3
+ service: Disk
4
+ root: <%= Rails.root.join("storage") %>
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.7.3
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: 2022-12-07 00:00:00.000000000 Z
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
@@ -576,6 +578,7 @@ test_files:
576
578
  - test/dummy/config/locales/en.yml
577
579
  - test/dummy/config/routes.rb
578
580
  - test/dummy/config/secrets.yml
581
+ - test/dummy/config/storage.yml
579
582
  - test/dummy/config.ru
580
583
  - test/dummy/db/migrate/20150608130516_create_date_field.rb
581
584
  - test/dummy/db/migrate/20150608131430_create_integer_field.rb
@@ -611,7 +614,6 @@ test_files:
611
614
  - test/fixtures/string_field.yml
612
615
  - test/fixtures/tree.yml
613
616
  - test/forest_liana_test.rb
614
- - test/routing/route_test.rb
615
617
  - test/services/forest_liana/operator_date_interval_parser_test.rb
616
618
  - test/services/forest_liana/schema_adapter_test.rb
617
619
  - test/test_helper.rb
@@ -663,6 +665,7 @@ test_files:
663
665
  - spec/dummy/config/initializers/wrap_parameters.rb
664
666
  - spec/dummy/config/routes.rb
665
667
  - spec/dummy/config/secrets.yml
668
+ - spec/dummy/config/storage.yml
666
669
  - spec/dummy/config.ru
667
670
  - spec/dummy/db/migrate/20190226172951_create_user.rb
668
671
  - spec/dummy/db/migrate/20190226173051_create_isle.rb
@@ -695,6 +698,7 @@ test_files:
695
698
  - spec/requests/resources_spec.rb
696
699
  - spec/requests/stats_spec.rb
697
700
  - spec/requests/test.ru
701
+ - spec/routing/routes_spec.rb
698
702
  - spec/services/forest_liana/apimap_sorter_spec.rb
699
703
  - spec/services/forest_liana/filters_parser_spec.rb
700
704
  - spec/services/forest_liana/has_many_getter_spec.rb
@@ -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