bookingsync-engine 5.1.0 → 6.0.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 +4 -4
- data/app/views/sessions/failure.html.erb +3 -1
- data/lib/bookingsync-engine.rb +3 -0
- data/lib/bookingsync/engine/auth_helpers.rb +38 -16
- data/lib/bookingsync/engine/models/account.rb +9 -3
- data/lib/bookingsync/engine/models/multi_applications_account.rb +9 -3
- data/lib/bookingsync/engine/version.rb +1 -1
- data/spec/controllers/authenticated_controller_spec.rb +36 -12
- data/spec/dummy/config/initializers/bookingsync-engine.rb +8 -0
- data/spec/dummy/db/migrate/20190623220013_add_custom_booking_sync_key_id_to_accounts.rb +5 -0
- data/spec/dummy/db/migrate/20190623220132_add_custom_booking_sync_key_id_to_multi_applications_accounts.rb +5 -0
- data/spec/dummy/db/schema.rb +3 -1
- data/spec/dummy/log/development.log +2 -263
- data/spec/dummy/log/test.log +9359 -67231
- data/spec/fixtures/accounts.yml +2 -0
- data/spec/models/account_spec.rb +11 -0
- data/spec/models/multi_application_account_spec.rb +12 -0
- metadata +37 -5
data/spec/fixtures/accounts.yml
CHANGED
@@ -7,6 +7,7 @@ one:
|
|
7
7
|
oauth_access_token: MyString
|
8
8
|
oauth_refresh_token: MyString
|
9
9
|
oauth_expires_at: MyString
|
10
|
+
customized_key: 1
|
10
11
|
|
11
12
|
two:
|
12
13
|
provider: MyString
|
@@ -15,3 +16,4 @@ two:
|
|
15
16
|
oauth_access_token: MyString
|
16
17
|
oauth_refresh_token: MyString
|
17
18
|
oauth_expires_at: MyString
|
19
|
+
customized_key: 1
|
data/spec/models/account_spec.rb
CHANGED
@@ -67,6 +67,7 @@ RSpec.describe Account, type: :model do
|
|
67
67
|
end
|
68
68
|
end
|
69
69
|
|
70
|
+
# deprecated
|
70
71
|
describe ".find_by_host_and_synced_id" do
|
71
72
|
let!(:account_1) { Account.create!(synced_id: 1) }
|
72
73
|
let!(:account_2) { Account.create!(synced_id: 2) }
|
@@ -77,6 +78,16 @@ RSpec.describe Account, type: :model do
|
|
77
78
|
end
|
78
79
|
end
|
79
80
|
|
81
|
+
describe ".find_by_host_and_bookingsync_id_key" do
|
82
|
+
let!(:account_1) { Account.create!(synced_id: 1) }
|
83
|
+
let!(:account_2) { Account.create!(synced_id: 2) }
|
84
|
+
let!(:account_3) { Account.create!(synced_id: 3) }
|
85
|
+
|
86
|
+
it "returns the right account" do
|
87
|
+
expect(Account.find_by_host_and_bookingsync_id_key("any_host", 3)).to eq account_3
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
80
91
|
describe "#token" do
|
81
92
|
let!(:account) { Account.create!(synced_id: 123, oauth_access_token: "token",
|
82
93
|
oauth_refresh_token: "refresh_token", oauth_expires_at: expires_at) }
|
@@ -75,6 +75,7 @@ RSpec.describe MultiApplicationsAccount, type: :model do
|
|
75
75
|
end
|
76
76
|
end
|
77
77
|
|
78
|
+
# deprecated
|
78
79
|
describe ".find_by_host_and_synced_id" do
|
79
80
|
let!(:account_1) { MultiApplicationsAccount.create!(synced_id: 1, host: "example.test") }
|
80
81
|
let!(:account_2) { MultiApplicationsAccount.create!(synced_id: 2, host: "example.test") }
|
@@ -86,6 +87,17 @@ RSpec.describe MultiApplicationsAccount, type: :model do
|
|
86
87
|
end
|
87
88
|
end
|
88
89
|
|
90
|
+
describe ".find_by_host_and_bookingsync_id_key" do
|
91
|
+
let!(:account_1) { MultiApplicationsAccount.create!(synced_id: 1, host: "example.test") }
|
92
|
+
let!(:account_2) { MultiApplicationsAccount.create!(synced_id: 2, host: "example.test") }
|
93
|
+
let!(:account_3) { MultiApplicationsAccount.create!(synced_id: 1, host: "example2.test") }
|
94
|
+
let!(:account_4) { MultiApplicationsAccount.create!(synced_id: 2, host: "example2.test") }
|
95
|
+
|
96
|
+
it "returns the right account" do
|
97
|
+
expect(MultiApplicationsAccount.find_by_host_and_bookingsync_id_key("example2.test", 1)).to eq account_3
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
89
101
|
describe "#token" do
|
90
102
|
|
91
103
|
let!(:account) do
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bookingsync-engine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 6.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sebastien Grosjean
|
8
8
|
- Grzesiek Kolodziejczyk
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2021-02-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -39,6 +39,34 @@ dependencies:
|
|
39
39
|
- - ">="
|
40
40
|
- !ruby/object:Gem::Version
|
41
41
|
version: 0.5.0
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: omniauth-rails_csrf_protection
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - "~>"
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '1.0'
|
49
|
+
type: :runtime
|
50
|
+
prerelease: false
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - "~>"
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '1.0'
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: repost
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - "~>"
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0.3'
|
63
|
+
type: :runtime
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - "~>"
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0.3'
|
42
70
|
- !ruby/object:Gem::Dependency
|
43
71
|
name: bookingsync-api
|
44
72
|
requirement: !ruby/object:Gem::Requirement
|
@@ -255,6 +283,8 @@ files:
|
|
255
283
|
- spec/dummy/db/migrate/20181130062650_add_o_auth_fields_to_multi_applications_accounts.rb
|
256
284
|
- spec/dummy/db/migrate/20181130063056_create_applications.rb
|
257
285
|
- spec/dummy/db/migrate/20181130063104_add_credentials_fields_to_applications.rb
|
286
|
+
- spec/dummy/db/migrate/20190623220013_add_custom_booking_sync_key_id_to_accounts.rb
|
287
|
+
- spec/dummy/db/migrate/20190623220132_add_custom_booking_sync_key_id_to_multi_applications_accounts.rb
|
258
288
|
- spec/dummy/db/schema.rb
|
259
289
|
- spec/dummy/log/development.log
|
260
290
|
- spec/dummy/log/test.log
|
@@ -277,7 +307,7 @@ homepage: https://github.com/BookingSync/bookingsync-engine
|
|
277
307
|
licenses:
|
278
308
|
- MIT
|
279
309
|
metadata: {}
|
280
|
-
post_install_message:
|
310
|
+
post_install_message:
|
281
311
|
rdoc_options: []
|
282
312
|
require_paths:
|
283
313
|
- lib
|
@@ -293,7 +323,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
293
323
|
version: '0'
|
294
324
|
requirements: []
|
295
325
|
rubygems_version: 3.0.1
|
296
|
-
signing_key:
|
326
|
+
signing_key:
|
297
327
|
specification_version: 4
|
298
328
|
summary: A Rails engine to simplify integration with BookingSync API
|
299
329
|
test_files:
|
@@ -343,6 +373,8 @@ test_files:
|
|
343
373
|
- spec/dummy/db/migrate/20181130062650_add_o_auth_fields_to_multi_applications_accounts.rb
|
344
374
|
- spec/dummy/db/migrate/20181130063056_create_applications.rb
|
345
375
|
- spec/dummy/db/migrate/20181130063104_add_credentials_fields_to_applications.rb
|
376
|
+
- spec/dummy/db/migrate/20190623220013_add_custom_booking_sync_key_id_to_accounts.rb
|
377
|
+
- spec/dummy/db/migrate/20190623220132_add_custom_booking_sync_key_id_to_multi_applications_accounts.rb
|
346
378
|
- spec/dummy/db/migrate/20140522110326_create_accounts.rb
|
347
379
|
- spec/dummy/db/migrate/20181130062531_create_multi_applications_accounts.rb
|
348
380
|
- spec/dummy/log/test.log
|