Skip to content

Commit

Permalink
Add timeline_events nested below data
Browse files Browse the repository at this point in the history
Part of #1090

This allows for data to have other logical groupings  in the future.
  • Loading branch information
jrafanie committed Nov 17, 2021
1 parent 9d5fac8 commit cc071d5
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/api/event_streams_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ def options
end

def build_additional_fields
EventStream.event_stream_options
{:timeline_events => EventStream.timeline_options}
end
end
end
44 changes: 44 additions & 0 deletions spec/requests/event_streams_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -162,4 +162,48 @@
expect(response).to have_http_status(:forbidden)
end
end

describe 'OPTIONS /api/event_streams' do
it 'returns expected and additional attributes' do
options(api_event_streams_url)

expected_data = {
"timeline_events" => {
"EmsEvent" => {
"description" => "Management Events",
"group_names" => {
"addition" => "Creation/Addition",
"configuration" => "Configuration/Reconfiguration",
"console" => "Console Activity",
"deletion" => "Deletion/Removal",
"general" => "General Activity",
"import_export" => "Import/Export",
"migration" => "Migration/Vmotion",
"network" => "Network",
"power" => "Power Activity",
"snapshot" => "Snapshot Activity",
"status" => "Status",
"storage" => "Storage",
"update" => "Update",
"firmware" => "Firmware",
"devices" => "Devices",
"login" => "Login",
"security" => "Security"
},
"group_levels" => {
"critical" => "Critical",
"detail" => "Detail",
"warning" => "Warning"
}
},
"MiqEvent" => {
"description" => "Policy Events",
"group_names" => {},
"group_levels" => {"success" => "Success", "failure" => "Failure"}
}
}
}
expect_options_results(:event_streams, expected_data)
end
end
end

0 comments on commit cc071d5

Please sign in to comment.