From 4375e7395aa275f6179b547fe7fcfa9eeecb5000 Mon Sep 17 00:00:00 2001 From: Jon Willesen Date: Thu, 24 Jan 2013 13:45:51 -0700 Subject: [PATCH] fix an intermittent calendar events api spec failure fixes #CNVS-3326 - the order of the events was not well defined since they had the same start and end dates. Change-Id: If3398c4acda49d03440b31b7f55c285f84c58949 Reviewed-on: https://gerrit.instructure.com/17112 Tested-by: Jenkins Reviewed-by: Zach Pendleton QA-Review: Bryan Madsen --- spec/apis/v1/calendar_events_api_spec.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/spec/apis/v1/calendar_events_api_spec.rb b/spec/apis/v1/calendar_events_api_spec.rb index 9cbba03e837..d9481efb463 100644 --- a/spec/apis/v1/calendar_events_api_spec.rb +++ b/spec/apis/v1/calendar_events_api_spec.rb @@ -355,9 +355,15 @@ describe CalendarEventsApiController, :type => :integration do e['child_events_count'].should eql 2 e['child_events'].size.should eql 1 # can't see otherguy's stuff e['available_slots'].should eql 2 + case e['id'] + when event1.id + e['child_events'].first.keys.sort.should eql((expected_reservation_fields + ['own_reservation', 'user']).sort) + when event2.id + e['child_events'].first.keys.sort.should eql((expected_reservation_fields + ['own_reservation', 'group'] - ['effective_context_code']).sort) + else + fail "unexpected event id" + end end - json.first['child_events'].first.keys.sort.should eql((expected_reservation_fields + ['own_reservation', 'user']).sort) - json.last['child_events'].first.keys.sort.should eql((expected_reservation_fields + ['own_reservation', 'group'] - ['effective_context_code']).sort) end context "reservations" do