diff --git a/app/controllers/api/event_streams_controller.rb b/app/controllers/api/event_streams_controller.rb index 5ccd423568..2179be9422 100644 --- a/app/controllers/api/event_streams_controller.rb +++ b/app/controllers/api/event_streams_controller.rb @@ -5,7 +5,7 @@ def options end def build_additional_fields - EventStream.event_stream_options + {:timeline_events => EventStream.timeline_options} end end end diff --git a/spec/requests/event_streams_spec.rb b/spec/requests/event_streams_spec.rb index 8f05a82b23..3a5eb03446 100644 --- a/spec/requests/event_streams_spec.rb +++ b/spec/requests/event_streams_spec.rb @@ -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