From 1155466d1b864e2d3904d5822a10688fa6760a60 Mon Sep 17 00:00:00 2001 From: mroloux Date: Mon, 12 Feb 2024 13:53:09 +0100 Subject: [PATCH] Tweaked event log items (#100) --- lib/seatsio/domain.rb | 5 ++--- test/event_log/list_event_log_items_test.rb | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/seatsio/domain.rb b/lib/seatsio/domain.rb index 23b3872..8fdb15c 100644 --- a/lib/seatsio/domain.rb +++ b/lib/seatsio/domain.rb @@ -260,13 +260,12 @@ def initialize(data) end class EventLogItem - attr_reader :id, :workspace_key, :type, :date, :data + attr_reader :id, :type, :timestamp, :data def initialize(data) @id = data['id'] - @workspace_key = data['workspaceKey'] @type = data['type'] - @date = DateTime.iso8601(data['date']) + @timestamp = DateTime.iso8601(data['timestamp']) @data = data['data'] end end diff --git a/test/event_log/list_event_log_items_test.rb b/test/event_log/list_event_log_items_test.rb index ac5fa5a..d9204a4 100644 --- a/test/event_log/list_event_log_items_test.rb +++ b/test/event_log/list_event_log_items_test.rb @@ -24,9 +24,8 @@ def test_event_log_item_properties assert_equal('chart.created', event_log_item.type) assert_true(event_log_item.id > 0) - assert_not_nil(event_log_item.date) - assert_equal(@workspace.key, event_log_item.workspace_key) - assert_equal({ "key" => chart.key }, event_log_item.data) + assert_not_nil(event_log_item.timestamp) + assert_equal({ "key" => chart.key, "workspaceKey" => @workspace.key }, event_log_item.data) end end