Skip to content

Commit

Permalink
Tweaked event log items (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
mroloux authored Feb 12, 2024
1 parent aa77d5f commit 1155466
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions lib/seatsio/domain.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions test/event_log/list_event_log_items_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 1155466

Please sign in to comment.