lws 7.1.1 → 7.1.2

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: 71a8d517993d1edc2f3ee98d57c5e8d96722e8c30f3022e346eaeee1f548a8b8
4
- data.tar.gz: ca21b87824d2470ebfde323df4e979be95ca943d79df42ab454d66626ab50532
3
+ metadata.gz: a6ddf096778ba5030a935df95f904a65776bbd8b2dd30602e3c9d912124fb5cd
4
+ data.tar.gz: 739154dc2c9598eef580f9a562cff9ddccde3a0828e985c55429ceed74f03a5d
5
5
  SHA512:
6
- metadata.gz: 0bc0ba9e36161be2702592791d1c4baad190714b39fe5fe67e2e0b78c61cf80e5a53be2ce3d820497052b87e587f5efdfd0253fd4561f97debabfd961fb8b0d5
7
- data.tar.gz: 6db01df5b9610858c985e4d1ab711cf29538a9bed8601437a7f476c3d633417ed910a93ed0b32b3ed9d88a7d993667f2ae8a03689c4afd4e4e959cbc417cdee2
6
+ metadata.gz: c6f4e39e00a7277ed012c6d4a2a846dae249edf892db185d17c5a62efa012902bc388ed4e652a26e25eb30ea07e208fbe4ef08b19671c750a0e3f33aa719f8a5
7
+ data.tar.gz: 696ae43f1ed90d4674365f86d63d411fc21544cce16ba250079e0bcefef1143c9d908c6e01b18773b006fa9a704e45ebc85795ff044c28948bf16fb79f4da042
@@ -88,6 +88,46 @@ module LWS::Presence
88
88
  attribute :uuid
89
89
  end
90
90
 
91
+ # = The journal (entry) class
92
+ #
93
+ # @note
94
+ # This class is only used within the context of the {Location} class.
95
+ class Journal < LWS::Generic::Model
96
+ use_api LWS::Presence.api
97
+
98
+ # @!attribute check_in
99
+ # @return [String] the timestamp of the check-in of this journal (entry)
100
+ attribute :check_in
101
+
102
+ # @!attribute check_out
103
+ # @return [String, nil] the timestamp of the check out of this journal (entry)
104
+ attribute :check_out
105
+
106
+ # @!attribute company
107
+ # @return [LWS::Auth::Company] the company the journal (entry) belongs to
108
+ belongs_to :company, class_name: "LWS::Auth::Company"
109
+
110
+ # @!attribute company_id
111
+ # @return [Integer] the ID of the company the journal (entry) belongs to
112
+ attribute :company_id
113
+
114
+ # @!attribute location
115
+ # @return [Location] the location the journal (entry) belongs to
116
+ belongs_to :location
117
+
118
+ # @!attribute location_id
119
+ # @return [Integer] the ID of the location the journal (entry) belongs to
120
+ attribute :location_id
121
+
122
+ # @!attribute person
123
+ # @return [Person] the person the journal (entry) belongs to
124
+ belongs_to :person
125
+
126
+ # @!attribute person_id
127
+ # @return [Integer] the ID of the person the journal (entry) belongs to
128
+ attribute :person_id
129
+ end
130
+
91
131
  # = The location class
92
132
  class Location < LWS::Generic::Model
93
133
  use_api LWS::Presence.api
@@ -176,6 +216,10 @@ module LWS::Presence
176
216
  # @return [String, nil] the URL of the image of the location
177
217
  attribute :image_url
178
218
 
219
+ # @!attribute journals
220
+ # @return [Array<Journal>] the journal (entries) associated with the location
221
+ has_many :journals, class: "LWS::Presence::Journal"
222
+
179
223
  # @!attribute lat
180
224
  # @return [Float] the latitude of the location
181
225
  attribute :lat
@@ -13,6 +13,6 @@ module LWS
13
13
 
14
14
  # The LWS library version.
15
15
  # @note The major and minor version parts match the LWS API version!
16
- VERSION = "7.1.1".freeze
16
+ VERSION = "7.1.2".freeze
17
17
 
18
18
  end
@@ -16,7 +16,7 @@ class TestCorporateWebsiteArticle < MiniTest::Test
16
16
  include LWS::CorporateWebsite
17
17
 
18
18
  def setup
19
- @page = Page.all.first
19
+ @page = Page.find(1)
20
20
  @article = @page.articles.first
21
21
  end
22
22
 
@@ -38,7 +38,7 @@ class TestCorporateWebsiteOfficeTime < MiniTest::Test
38
38
  include LWS::CorporateWebsite
39
39
 
40
40
  def setup
41
- @office_time = OfficeTime.all.first
41
+ @office_time = OfficeTime.find(1)
42
42
  end
43
43
 
44
44
  def test_valid
@@ -54,7 +54,7 @@ class TestCorporateWebsitePage < MiniTest::Test
54
54
  include LWS::CorporateWebsite
55
55
 
56
56
  def setup
57
- @page = Page.all.first
57
+ @page = Page.find(1)
58
58
  end
59
59
 
60
60
  def test_valid
@@ -75,7 +75,7 @@ end
75
75
  # include LWS::CorporateWebsite
76
76
  #
77
77
  # def setup
78
- # @social_page = SocialPage.all.first
78
+ # @social_page = SocialPage.find(1)
79
79
  # end
80
80
  #
81
81
  # def test_valid
@@ -96,7 +96,7 @@ class TestCorporateWebsiteSocialPost < MiniTest::Test
96
96
  include LWS::CorporateWebsite
97
97
 
98
98
  def setup
99
- @social_post = SocialPost.all.first
99
+ @social_post = SocialPost.find(1)
100
100
  end
101
101
 
102
102
  def test_valid
@@ -17,7 +17,7 @@ class TestGenericModel < MiniTest::Test
17
17
  include LWS::Auth
18
18
 
19
19
  def setup
20
- @configuration = Configuration.all.first
20
+ @configuration = Configuration.find(1)
21
21
  end
22
22
 
23
23
  def test_her_compatibility
@@ -128,7 +128,7 @@ class TestGenericConfiguration < MiniTest::Test
128
128
  include LWS::Auth
129
129
 
130
130
  def setup
131
- @configuration = Configuration.all.first
131
+ @configuration = Configuration.find(1)
132
132
  end
133
133
 
134
134
  def test_valid
@@ -16,7 +16,7 @@ class TestMapsMap < MiniTest::Test
16
16
  include LWS::Maps
17
17
 
18
18
  def setup
19
- @map = Map.all.first
19
+ @map = Map.find(1)
20
20
  end
21
21
 
22
22
  def test_valid_map
@@ -37,7 +37,7 @@ class TestMapsMarker < MiniTest::Test
37
37
  include LWS::Maps
38
38
 
39
39
  def setup
40
- @map = Map.all.first
40
+ @map = Map.find(1)
41
41
  # Markers only exist as child objects of maps
42
42
  @marker = @map.markers.first
43
43
  end
@@ -60,7 +60,7 @@ class TestMapsSource < MiniTest::Test
60
60
  include LWS::Maps
61
61
 
62
62
  def setup
63
- @source = Source.all.first
63
+ @source = Source.find(1)
64
64
  end
65
65
 
66
66
  def test_valid_source
@@ -35,6 +35,29 @@ class TestPresenceAppointment < MiniTest::Test
35
35
 
36
36
  end
37
37
 
38
+ class TestPresenceJournal < MiniTest::Test
39
+ include LWS::Presence
40
+
41
+ def setup
42
+ @location = Location.find(1)
43
+ # Journals only exist as child objects of a location
44
+ @journal = @location.journals.first
45
+ end
46
+
47
+ def test_valid
48
+ refute_nil(@journal)
49
+ assert_instance_of(Journal, @journal)
50
+ refute_nil(@journal.id)
51
+ end
52
+
53
+ def test_valid_associations
54
+ assert_instance_of(LWS::Auth::Company, @journal.company)
55
+ assert_instance_of(Location, @journal.location)
56
+ assert_equal(@location, @journal.location)
57
+ assert_instance_of(Person, @journal.person)
58
+ end
59
+ end
60
+
38
61
  class TestPresenceLocation < MiniTest::Test
39
62
 
40
63
  include LWS::Presence
@@ -165,7 +188,7 @@ class TestPresenceReader < MiniTest::Test
165
188
  include LWS::Presence
166
189
 
167
190
  def setup
168
- @reader = Reader.all.first
191
+ @reader = Reader.find(1)
169
192
  end
170
193
 
171
194
  def test_valid
@@ -25,7 +25,7 @@ class TestResourceCollection < MiniTest::Test
25
25
  include LWS::Resource
26
26
 
27
27
  def setup
28
- @collection = Collection.all.first # FIXME
28
+ @collection = Collection.find(1)
29
29
  end
30
30
 
31
31
  def test_valid
@@ -48,7 +48,7 @@ class TestResourceCollectionItem < MiniTest::Test
48
48
  include LWS::Resource
49
49
 
50
50
  def setup
51
- @collection = Collection.where(includes: "items").first # FIXME
51
+ @collection = Collection.where(includes: "items").find(1)
52
52
  @collection_item = @collection.items.first
53
53
  end
54
54
 
@@ -70,7 +70,7 @@ class TestResourceFolder < MiniTest::Test
70
70
  include LWS::Resource
71
71
 
72
72
  def setup
73
- @folder = Folder.all.first
73
+ @folder = Folder.find(1)
74
74
  end
75
75
 
76
76
  def test_valid
@@ -40,7 +40,7 @@ class TestTicketGroup < MiniTest::Test
40
40
  include LWS::Ticket
41
41
 
42
42
  def setup
43
- @group = Group.all.first
43
+ @group = Group.find(1)
44
44
  end
45
45
 
46
46
  def test_valid
@@ -88,7 +88,7 @@ class TestTicketTag < MiniTest::Test
88
88
  include LWS::Ticket
89
89
 
90
90
  def setup
91
- @tag = Tag.all.first
91
+ @tag = Tag.find(1)
92
92
  end
93
93
 
94
94
  def test_valid_tag
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: 7.1.1
4
+ version: 7.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - LeftClick B.V.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-17 00:00:00.000000000 Z
11
+ date: 2020-07-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday_middleware
@@ -296,27 +296,27 @@ signing_key:
296
296
  specification_version: 4
297
297
  summary: LeftClick web services library for Ruby
298
298
  test_files:
299
+ - test/presence_test.rb
300
+ - test/fixtures/permissions.yml
301
+ - test/fixtures/auth.yml
302
+ - test/corporate_website_test.rb
303
+ - test/logger_test.rb
299
304
  - test/support/with_env.rb
300
- - test/json_parser_test.rb
301
- - test/test_helper.rb
302
- - test/setup_test.rb
303
- - test/ticket_test.rb
304
- - test/api_token_middleware_test.rb
305
305
  - test/stubbing_test.rb
306
- - test/presence_test.rb
306
+ - test/ticket_test.rb
307
307
  - test/digital_signage_test.rb
308
- - test/generic_test.rb
309
- - test/logger_test.rb
308
+ - test/caching_test.rb
310
309
  - test/auth_test.rb
311
- - test/resource_test.rb
312
310
  - test/maps_test.rb
313
- - test/corporate_website_test.rb
314
- - test/config/tokens.yml
315
- - test/config/empty.yml
311
+ - test/json_parser_test.rb
312
+ - test/resource_test.rb
316
313
  - test/config/endpoints.yml
317
- - test/config/invalid.yml
318
314
  - test/config/switch_env.yml
315
+ - test/config/invalid.yml
316
+ - test/config/empty.yml
317
+ - test/config/tokens.yml
319
318
  - test/config/full.yml
320
- - test/caching_test.rb
321
- - test/fixtures/auth.yml
322
- - test/fixtures/permissions.yml
319
+ - test/setup_test.rb
320
+ - test/api_token_middleware_test.rb
321
+ - test/generic_test.rb
322
+ - test/test_helper.rb