From 4a40bfed5a905a2b25c59a844c6e522a95b6c09c Mon Sep 17 00:00:00 2001 From: Ivan Kuchin Date: Sat, 6 Mar 2021 14:37:20 +0100 Subject: [PATCH] refactor test_get_events_by_id a bit --- test/app_test.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/app_test.rb b/test/app_test.rb index 6cb412a..cd6a36c 100644 --- a/test/app_test.rb +++ b/test/app_test.rb @@ -95,10 +95,10 @@ def test_get_events_by_id assert_equal 200, last_response.status events = last_response.body.split(/\n+/) # two events, printed with blank lines separating them - synergy_event = parse_data(events[0]) - valuation_event = parse_data(events[1]) - assert_equal ['synergy', 3], [synergy_event['id'], synergy_event['value']] - assert_equal %w[valuation a], [valuation_event['id'], valuation_event['value']] + assert_equal 2, events.length + + assert_equal ['synergy', 3], parse_data(events[0]).values_at('id', 'value') + assert_equal %w[valuation a], parse_data(events[1]).values_at('id', 'value') end end