lws 8.1.0 → 9.0.0.beta1
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/lib/lws/version.rb +1 -1
- metadata +21 -65
- data/test/api_token_middleware_test.rb +0 -59
- data/test/auth_test.rb +0 -190
- data/test/caching_test.rb +0 -65
- data/test/config/empty.yml +0 -2
- data/test/config/endpoints.yml +0 -4
- data/test/config/full.yml +0 -16
- data/test/config/invalid.yml +0 -3
- data/test/config/switch_env.yml +0 -3
- data/test/config/tokens.yml +0 -3
- data/test/corporate_website_test.rb +0 -113
- data/test/digital_signage_test.rb +0 -980
- data/test/fixtures/auth.yml +0 -73
- data/test/fixtures/permissions.yml +0 -27
- data/test/generic_test.rb +0 -179
- data/test/http_caching_test.rb +0 -82
- data/test/json_parser_test.rb +0 -92
- data/test/logger_test.rb +0 -36
- data/test/maps_test.rb +0 -78
- data/test/presence_test.rb +0 -205
- data/test/resource_test.rb +0 -91
- data/test/setup_test.rb +0 -177
- data/test/stubbing_test.rb +0 -74
- data/test/support/with_env.rb +0 -25
- data/test/test_helper.rb +0 -77
- data/test/ticket_test.rb +0 -131
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d01521b79771c5738beda11b619bf9c6d3efb9d50bd6042488b9b075b230986
|
4
|
+
data.tar.gz: c8672087043ae72f3fcc5b5d67858b915ced679338e98156e81335cd5fce2aa5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d55aa2c3c84ee3ca2d3ea8293a898d68bb2b1b43645b9a774fa18ac91773d0c38e0d8c618b1b746265cdffe41ac903cb32feffe8193538a4f5c0f6755822d90f
|
7
|
+
data.tar.gz: d2500629a3c85138bbd4a2bd8b2f0ba9a34828833cf5c67f0cb15d24d743fd7c67508287e966756b2b52576997d56830792452525e95f7d243abd29a31ee6658
|
data/lib/lws/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lws
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 9.0.0.beta1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- LeftClick B.V.
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-06-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday-http-cache
|
@@ -48,16 +48,22 @@ dependencies:
|
|
48
48
|
name: hashie
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
|
-
- - "
|
51
|
+
- - ">="
|
52
52
|
- !ruby/object:Gem::Version
|
53
53
|
version: '3.5'
|
54
|
+
- - "<"
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: '6'
|
54
57
|
type: :runtime
|
55
58
|
prerelease: false
|
56
59
|
version_requirements: !ruby/object:Gem::Requirement
|
57
60
|
requirements:
|
58
|
-
- - "
|
61
|
+
- - ">="
|
59
62
|
- !ruby/object:Gem::Version
|
60
63
|
version: '3.5'
|
64
|
+
- - "<"
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: '6'
|
61
67
|
- !ruby/object:Gem::Dependency
|
62
68
|
name: multi_json
|
63
69
|
requirement: !ruby/object:Gem::Requirement
|
@@ -113,9 +119,9 @@ dependencies:
|
|
113
119
|
- - ">="
|
114
120
|
- !ruby/object:Gem::Version
|
115
121
|
version: '5.3'
|
116
|
-
- - "
|
122
|
+
- - "~>"
|
117
123
|
- !ruby/object:Gem::Version
|
118
|
-
version:
|
124
|
+
version: 7.2.2
|
119
125
|
type: :runtime
|
120
126
|
prerelease: false
|
121
127
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -123,9 +129,9 @@ dependencies:
|
|
123
129
|
- - ">="
|
124
130
|
- !ruby/object:Gem::Version
|
125
131
|
version: '5.3'
|
126
|
-
- - "
|
132
|
+
- - "~>"
|
127
133
|
- !ruby/object:Gem::Version
|
128
|
-
version:
|
134
|
+
version: 7.2.2
|
129
135
|
- !ruby/object:Gem::Dependency
|
130
136
|
name: webmock
|
131
137
|
requirement: !ruby/object:Gem::Requirement
|
@@ -274,35 +280,10 @@ files:
|
|
274
280
|
- lib/lws/middleware/request_headers.rb
|
275
281
|
- lib/lws/stubbing.rb
|
276
282
|
- lib/lws/version.rb
|
277
|
-
- test/api_token_middleware_test.rb
|
278
|
-
- test/auth_test.rb
|
279
|
-
- test/caching_test.rb
|
280
|
-
- test/config/empty.yml
|
281
|
-
- test/config/endpoints.yml
|
282
|
-
- test/config/full.yml
|
283
|
-
- test/config/invalid.yml
|
284
|
-
- test/config/switch_env.yml
|
285
|
-
- test/config/tokens.yml
|
286
|
-
- test/corporate_website_test.rb
|
287
|
-
- test/digital_signage_test.rb
|
288
|
-
- test/fixtures/auth.yml
|
289
|
-
- test/fixtures/permissions.yml
|
290
|
-
- test/generic_test.rb
|
291
|
-
- test/http_caching_test.rb
|
292
|
-
- test/json_parser_test.rb
|
293
|
-
- test/logger_test.rb
|
294
|
-
- test/maps_test.rb
|
295
|
-
- test/presence_test.rb
|
296
|
-
- test/resource_test.rb
|
297
|
-
- test/setup_test.rb
|
298
|
-
- test/stubbing_test.rb
|
299
|
-
- test/support/with_env.rb
|
300
|
-
- test/test_helper.rb
|
301
|
-
- test/ticket_test.rb
|
302
283
|
homepage: https://leftclick.eu/
|
303
284
|
licenses: []
|
304
285
|
metadata: {}
|
305
|
-
post_install_message:
|
286
|
+
post_install_message:
|
306
287
|
rdoc_options: []
|
307
288
|
require_paths:
|
308
289
|
- lib
|
@@ -313,37 +294,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
313
294
|
version: '0'
|
314
295
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
315
296
|
requirements:
|
316
|
-
- - "
|
297
|
+
- - ">"
|
317
298
|
- !ruby/object:Gem::Version
|
318
|
-
version:
|
299
|
+
version: 1.3.1
|
319
300
|
requirements: []
|
320
|
-
rubygems_version: 3.3.
|
321
|
-
signing_key:
|
301
|
+
rubygems_version: 3.3.15
|
302
|
+
signing_key:
|
322
303
|
specification_version: 4
|
323
304
|
summary: LeftClick web services library for Ruby
|
324
|
-
test_files:
|
325
|
-
- test/api_token_middleware_test.rb
|
326
|
-
- test/auth_test.rb
|
327
|
-
- test/caching_test.rb
|
328
|
-
- test/config/empty.yml
|
329
|
-
- test/config/endpoints.yml
|
330
|
-
- test/config/full.yml
|
331
|
-
- test/config/invalid.yml
|
332
|
-
- test/config/switch_env.yml
|
333
|
-
- test/config/tokens.yml
|
334
|
-
- test/corporate_website_test.rb
|
335
|
-
- test/digital_signage_test.rb
|
336
|
-
- test/fixtures/auth.yml
|
337
|
-
- test/fixtures/permissions.yml
|
338
|
-
- test/generic_test.rb
|
339
|
-
- test/http_caching_test.rb
|
340
|
-
- test/json_parser_test.rb
|
341
|
-
- test/logger_test.rb
|
342
|
-
- test/maps_test.rb
|
343
|
-
- test/presence_test.rb
|
344
|
-
- test/resource_test.rb
|
345
|
-
- test/setup_test.rb
|
346
|
-
- test/stubbing_test.rb
|
347
|
-
- test/support/with_env.rb
|
348
|
-
- test/test_helper.rb
|
349
|
-
- test/ticket_test.rb
|
305
|
+
test_files: []
|
@@ -1,59 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# Copyright © 2016–2021 LeftClick Web Services B.V.
|
3
|
-
#
|
4
|
-
# This software is property of LeftClick Web Services B.V. and cannot be
|
5
|
-
# redistributed and/or modified without permission. The software or any
|
6
|
-
# of its parts cannot be used for any other purposes than the LeftClick
|
7
|
-
# services and only during a valid license subscription. For more
|
8
|
-
# information, please contact LeftClick Web Services B.V. at:
|
9
|
-
# Schootense Dreef 20A, 5708 HZ Helmond, The Netherlands,
|
10
|
-
# info@leftclick.eu, +3185-4444-004.
|
11
|
-
|
12
|
-
|
13
|
-
require "test_helper"
|
14
|
-
|
15
|
-
class WorkingTokenAuthenticator < Faraday::Middleware
|
16
|
-
|
17
|
-
def call(env)
|
18
|
-
env[:request_headers]["X-Token"] = ENV["LC_LWS_TEST_TOKEN"]
|
19
|
-
@app.call(env)
|
20
|
-
end
|
21
|
-
|
22
|
-
end
|
23
|
-
|
24
|
-
class BrokenTokenAuthenticator < Faraday::Middleware
|
25
|
-
|
26
|
-
def call(env)
|
27
|
-
env[:request_headers]["X-Token"] = ""
|
28
|
-
@app.call(env)
|
29
|
-
end
|
30
|
-
|
31
|
-
end
|
32
|
-
|
33
|
-
class TestAPITokenMiddleware < MiniTest::Test
|
34
|
-
|
35
|
-
def test_working_token_authenticator
|
36
|
-
# Configure the working token authenticator instead of the test API token
|
37
|
-
reconfigure(api_token: nil,
|
38
|
-
api_token_middleware: WorkingTokenAuthenticator)
|
39
|
-
|
40
|
-
token = LWS::Auth::Token.all.first
|
41
|
-
refute_nil(token)
|
42
|
-
|
43
|
-
# Restore the token
|
44
|
-
reconfigure
|
45
|
-
end
|
46
|
-
|
47
|
-
def test_broken_token_authenticator
|
48
|
-
# Configure the working token authenticator instead of the test API token
|
49
|
-
reconfigure(api_token: nil,
|
50
|
-
api_token_middleware: BrokenTokenAuthenticator)
|
51
|
-
|
52
|
-
token = LWS::Auth::Token.all.first
|
53
|
-
assert_nil(token)
|
54
|
-
|
55
|
-
# Restore the token
|
56
|
-
reconfigure
|
57
|
-
end
|
58
|
-
|
59
|
-
end
|
data/test/auth_test.rb
DELETED
@@ -1,190 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# Copyright © 2016–2021 LeftClick Web Services B.V.
|
3
|
-
#
|
4
|
-
# This software is property of LeftClick Web Services B.V. and cannot be
|
5
|
-
# redistributed and/or modified without permission. The software or any
|
6
|
-
# of its parts cannot be used for any other purposes than the LeftClick
|
7
|
-
# services and only during a valid license subscription. For more
|
8
|
-
# information, please contact LeftClick Web Services B.V. at:
|
9
|
-
# Schootense Dreef 20A, 5708 HZ Helmond, The Netherlands,
|
10
|
-
# info@leftclick.eu, +3185-4444-004.
|
11
|
-
|
12
|
-
|
13
|
-
require "test_helper"
|
14
|
-
|
15
|
-
class TestAuthAccount < MiniTest::Test
|
16
|
-
|
17
|
-
include LWS::Auth
|
18
|
-
|
19
|
-
def setup
|
20
|
-
@account = Account.find(1)
|
21
|
-
end
|
22
|
-
|
23
|
-
def test_valid
|
24
|
-
refute_nil(@account)
|
25
|
-
assert_instance_of(Account, @account)
|
26
|
-
refute_nil(@account.id)
|
27
|
-
end
|
28
|
-
|
29
|
-
def test_valid_associations
|
30
|
-
assert_instance_of(App, @account.apps.first)
|
31
|
-
assert_instance_of(Company, @account.company)
|
32
|
-
if @account.users.present?
|
33
|
-
assert_instance_of(User, @account.users.first)
|
34
|
-
end
|
35
|
-
if @account.devices.present?
|
36
|
-
assert_instance_of(Device, @account.devices.first)
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
end
|
41
|
-
|
42
|
-
class TestAuthApp < MiniTest::Test
|
43
|
-
|
44
|
-
include LWS::Auth
|
45
|
-
|
46
|
-
def setup
|
47
|
-
@app = App.all.first
|
48
|
-
end
|
49
|
-
|
50
|
-
def test_valid
|
51
|
-
refute_nil(@app)
|
52
|
-
assert_instance_of(App, @app)
|
53
|
-
refute_nil(@app.id)
|
54
|
-
end
|
55
|
-
|
56
|
-
def test_valid_associations
|
57
|
-
# FIXME: Doesn't work
|
58
|
-
#assert_instance_of(Account, @app.accounts.first)
|
59
|
-
#assert_instance_of(Company, @app.companies.first)
|
60
|
-
#assert_instance_of(License, @app.licenses.first)
|
61
|
-
end
|
62
|
-
|
63
|
-
end
|
64
|
-
|
65
|
-
class TestAuthCompany < MiniTest::Test
|
66
|
-
|
67
|
-
include LWS::Auth
|
68
|
-
|
69
|
-
def setup
|
70
|
-
@company = Company.find(1)
|
71
|
-
@child_company = Company.find(2)
|
72
|
-
end
|
73
|
-
|
74
|
-
def test_valid
|
75
|
-
refute_nil(@company)
|
76
|
-
assert_instance_of(Company, @company)
|
77
|
-
refute_nil(@company.id)
|
78
|
-
end
|
79
|
-
|
80
|
-
def test_valid_associations
|
81
|
-
assert_instance_of(Account, @company.accounts.first)
|
82
|
-
assert_instance_of(App, @company.apps.first)
|
83
|
-
assert_instance_of(Account, @company.contact_person)
|
84
|
-
assert_instance_of(Contract, @company.contracts.first)
|
85
|
-
assert_instance_of(License, @company.licenses.first)
|
86
|
-
assert_instance_of(Company, @child_company.parent)
|
87
|
-
assert_instance_of(UsageReport, @company.usage_reports.first)
|
88
|
-
end
|
89
|
-
|
90
|
-
end
|
91
|
-
|
92
|
-
class TestAuthContract < MiniTest::Test
|
93
|
-
|
94
|
-
include LWS::Auth
|
95
|
-
|
96
|
-
def setup
|
97
|
-
@company = Company.find(1)
|
98
|
-
# Contracts only exist as child objects of companies
|
99
|
-
@contract = @company.contracts.first
|
100
|
-
end
|
101
|
-
|
102
|
-
def test_valid
|
103
|
-
refute_nil(@contract)
|
104
|
-
assert_instance_of(Contract, @contract)
|
105
|
-
refute_nil(@contract.id)
|
106
|
-
end
|
107
|
-
|
108
|
-
def test_valid_associations
|
109
|
-
assert_instance_of(Company, @contract.company)
|
110
|
-
assert_equal(@company, @contract.company)
|
111
|
-
end
|
112
|
-
|
113
|
-
end
|
114
|
-
|
115
|
-
class TestAuthLicense < MiniTest::Test
|
116
|
-
|
117
|
-
include LWS::Auth
|
118
|
-
|
119
|
-
def setup
|
120
|
-
@company = Company.find(1)
|
121
|
-
# Licenses only exist as child objects of companies
|
122
|
-
@license = @company.licenses.first
|
123
|
-
end
|
124
|
-
|
125
|
-
def test_valid
|
126
|
-
refute_nil(@license)
|
127
|
-
assert_instance_of(License, @license)
|
128
|
-
refute_nil(@license.id)
|
129
|
-
end
|
130
|
-
|
131
|
-
def test_valid_associations
|
132
|
-
assert_instance_of(App, @license.app)
|
133
|
-
assert_instance_of(Company, @license.company)
|
134
|
-
assert_equal(@company, @license.company)
|
135
|
-
end
|
136
|
-
|
137
|
-
end
|
138
|
-
|
139
|
-
class TestAuthToken < MiniTest::Test
|
140
|
-
|
141
|
-
include LWS::Auth
|
142
|
-
|
143
|
-
def setup
|
144
|
-
@token = Token.find(ENV["LC_LWS_TEST_TOKEN"])
|
145
|
-
end
|
146
|
-
|
147
|
-
def test_valid
|
148
|
-
refute_nil(@token)
|
149
|
-
assert_instance_of(Token, @token)
|
150
|
-
refute_nil(@token.id)
|
151
|
-
assert_equal(LWS.config.api_token, @token.token)
|
152
|
-
end
|
153
|
-
|
154
|
-
def test_valid_associations
|
155
|
-
assert_instance_of(Account, @token.account)
|
156
|
-
if @token.user.present?
|
157
|
-
assert_instance_of(User, @token.user)
|
158
|
-
assert_equal(@token.user.account.id, @token.account.id)
|
159
|
-
elsif @token.device.present?
|
160
|
-
assert_instance_of(Device, @token.device)
|
161
|
-
assert_equal(@token.device.account.id, @token.account.id)
|
162
|
-
else
|
163
|
-
fail "token should be associated with either a user or a device"
|
164
|
-
end
|
165
|
-
end
|
166
|
-
|
167
|
-
end
|
168
|
-
|
169
|
-
class TestAuthUsageReport < MiniTest::Test
|
170
|
-
|
171
|
-
include LWS::Auth
|
172
|
-
|
173
|
-
def setup
|
174
|
-
@company = Company.find(1)
|
175
|
-
# Contracts only exist as child objects of companies
|
176
|
-
@usage_report = @company.usage_reports.first
|
177
|
-
end
|
178
|
-
|
179
|
-
def test_valid
|
180
|
-
refute_nil(@usage_report)
|
181
|
-
assert_instance_of(UsageReport, @usage_report)
|
182
|
-
refute_nil(@usage_report.id)
|
183
|
-
end
|
184
|
-
|
185
|
-
def test_valid_associations
|
186
|
-
assert_instance_of(Company, @usage_report.company)
|
187
|
-
assert_equal(@company, @usage_report.company)
|
188
|
-
end
|
189
|
-
|
190
|
-
end
|
data/test/caching_test.rb
DELETED
@@ -1,65 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# Copyright © 2016–2021 LeftClick Web Services B.V.
|
3
|
-
#
|
4
|
-
# This software is property of LeftClick Web Services B.V. and cannot be
|
5
|
-
# redistributed and/or modified without permission. The software or any
|
6
|
-
# of its parts cannot be used for any other purposes than the LeftClick
|
7
|
-
# services and only during a valid license subscription. For more
|
8
|
-
# information, please contact LeftClick Web Services B.V. at:
|
9
|
-
# Schootense Dreef 20A, 5708 HZ Helmond, The Netherlands,
|
10
|
-
# info@leftclick.eu, +3185-4444-004.
|
11
|
-
|
12
|
-
|
13
|
-
require "test_helper"
|
14
|
-
|
15
|
-
class TestCaching < MiniTest::Test
|
16
|
-
|
17
|
-
# Class used to check if data is read/written to the cache
|
18
|
-
class CacheTest
|
19
|
-
|
20
|
-
attr_reader :last_read_key
|
21
|
-
attr_reader :last_written_key, :last_written_value
|
22
|
-
|
23
|
-
def read(key)
|
24
|
-
@last_read_key = key
|
25
|
-
nil
|
26
|
-
end
|
27
|
-
|
28
|
-
def write(key, value)
|
29
|
-
@last_written_key, @last_written_value = key, value
|
30
|
-
nil
|
31
|
-
end
|
32
|
-
|
33
|
-
end
|
34
|
-
|
35
|
-
def setup
|
36
|
-
@cache_mock = CacheTest.new
|
37
|
-
|
38
|
-
# Redo the LWS setup with cache
|
39
|
-
LWS.setup do |config|
|
40
|
-
config.api_token = ENV["LC_LWS_TEST_TOKEN"]
|
41
|
-
config.caching_object = @cache_mock
|
42
|
-
if ENV["LC_LWS_TEST_DEBUG"].present?
|
43
|
-
config.http_debug = true
|
44
|
-
config.json_debug = true
|
45
|
-
end
|
46
|
-
config.environment = :development
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
def teardown
|
51
|
-
# Restore the configuration
|
52
|
-
reconfigure
|
53
|
-
end
|
54
|
-
|
55
|
-
def test_working_cache
|
56
|
-
assert_nil(@cache_mock.last_read_key)
|
57
|
-
assert_nil(@cache_mock.last_written_key)
|
58
|
-
assert_nil(@cache_mock.last_written_value)
|
59
|
-
_configs = LWS::Auth::Configuration.all.to_a
|
60
|
-
refute_nil(@cache_mock.last_read_key)
|
61
|
-
assert_equal(@cache_mock.last_read_key, @cache_mock.last_written_key)
|
62
|
-
refute_nil(@cache_mock.last_written_value)
|
63
|
-
end
|
64
|
-
|
65
|
-
end
|
data/test/config/empty.yml
DELETED
data/test/config/endpoints.yml
DELETED
data/test/config/full.yml
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
---
|
2
|
-
default:
|
3
|
-
environment: development
|
4
|
-
proxy: http://user:password@proxyserver:8080
|
5
|
-
|
6
|
-
development:
|
7
|
-
api_token: "dev-token"
|
8
|
-
endpoints:
|
9
|
-
maps: "http://maps.leftclick.cloud"
|
10
|
-
http_debug: true
|
11
|
-
http_debug_headers: true
|
12
|
-
json_debug: true
|
13
|
-
|
14
|
-
production:
|
15
|
-
http_debug: false
|
16
|
-
json_debug: false
|
data/test/config/invalid.yml
DELETED
data/test/config/switch_env.yml
DELETED
data/test/config/tokens.yml
DELETED
@@ -1,113 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# Copyright © 2016–2021 LeftClick Web Services B.V.
|
3
|
-
#
|
4
|
-
# This software is property of LeftClick Web Services B.V. and cannot be
|
5
|
-
# redistributed and/or modified without permission. The software or any
|
6
|
-
# of its parts cannot be used for any other purposes than the LeftClick
|
7
|
-
# services and only during a valid license subscription. For more
|
8
|
-
# information, please contact LeftClick Web Services B.V. at:
|
9
|
-
# Schootense Dreef 20A, 5708 HZ Helmond, The Netherlands,
|
10
|
-
# info@leftclick.eu, +3185-4444-004.
|
11
|
-
|
12
|
-
|
13
|
-
require "test_helper"
|
14
|
-
|
15
|
-
class TestCorporateWebsiteArticle < MiniTest::Test
|
16
|
-
|
17
|
-
include LWS::CorporateWebsite
|
18
|
-
|
19
|
-
def setup
|
20
|
-
@page = Page.find(1)
|
21
|
-
@article = @page.articles.first
|
22
|
-
end
|
23
|
-
|
24
|
-
def test_valid
|
25
|
-
refute_nil(@article)
|
26
|
-
assert_instance_of(Article, @article)
|
27
|
-
refute_nil(@article.id)
|
28
|
-
end
|
29
|
-
|
30
|
-
def test_valid_associations
|
31
|
-
assert_instance_of(Page, @article.page)
|
32
|
-
assert_equal(@page, @article.page)
|
33
|
-
end
|
34
|
-
|
35
|
-
end
|
36
|
-
|
37
|
-
class TestCorporateWebsiteOfficeTime < MiniTest::Test
|
38
|
-
|
39
|
-
include LWS::CorporateWebsite
|
40
|
-
|
41
|
-
def setup
|
42
|
-
@office_time = OfficeTime.find(1)
|
43
|
-
end
|
44
|
-
|
45
|
-
def test_valid
|
46
|
-
refute_nil(@office_time)
|
47
|
-
assert_instance_of(OfficeTime, @office_time)
|
48
|
-
refute_nil(@office_time.id)
|
49
|
-
end
|
50
|
-
|
51
|
-
end
|
52
|
-
|
53
|
-
class TestCorporateWebsitePage < MiniTest::Test
|
54
|
-
|
55
|
-
include LWS::CorporateWebsite
|
56
|
-
|
57
|
-
def setup
|
58
|
-
@page = Page.find(1)
|
59
|
-
end
|
60
|
-
|
61
|
-
def test_valid
|
62
|
-
refute_nil(@page)
|
63
|
-
assert_instance_of(Page, @page)
|
64
|
-
refute_nil(@page.id)
|
65
|
-
end
|
66
|
-
|
67
|
-
def test_valid_associations
|
68
|
-
assert_instance_of(Article, @page.articles.first)
|
69
|
-
end
|
70
|
-
|
71
|
-
end
|
72
|
-
|
73
|
-
# FIXME: There is no social page to test
|
74
|
-
#class TestCorporateWebsiteSocialPage < MiniTest::Test
|
75
|
-
#
|
76
|
-
# include LWS::CorporateWebsite
|
77
|
-
#
|
78
|
-
# def setup
|
79
|
-
# @social_page = SocialPage.find(1)
|
80
|
-
# end
|
81
|
-
#
|
82
|
-
# def test_valid
|
83
|
-
# refute_nil(@social_page)
|
84
|
-
# assert_instance_of(SocialPage, @social_page)
|
85
|
-
# refute_nil(@social_page.id)
|
86
|
-
# end
|
87
|
-
#
|
88
|
-
# def test_valid_associations
|
89
|
-
# assert_instance_of(LWS::Auth::Account, @social_page.account)
|
90
|
-
# assert_instance_of(LWS::Auth::Company, @social_page.company)
|
91
|
-
# end
|
92
|
-
#
|
93
|
-
#end
|
94
|
-
|
95
|
-
class TestCorporateWebsiteSocialPost < MiniTest::Test
|
96
|
-
|
97
|
-
include LWS::CorporateWebsite
|
98
|
-
|
99
|
-
def setup
|
100
|
-
@social_post = SocialPost.find(1)
|
101
|
-
end
|
102
|
-
|
103
|
-
def test_valid
|
104
|
-
refute_nil(@social_post)
|
105
|
-
assert_instance_of(SocialPost, @social_post)
|
106
|
-
refute_nil(@social_post.id)
|
107
|
-
end
|
108
|
-
|
109
|
-
def test_valid_associations
|
110
|
-
assert_instance_of(Article, @social_post.article)
|
111
|
-
end
|
112
|
-
|
113
|
-
end
|