Maintain Ruby 1.8 support in calendar_events_api_spec for now.
Fixes #CNVS-3709 Testing Notes: =========== * Using Ruby 1.8.x, run the calendar_events_api_spec.rb tests and verify that they pass. Previously 3 tests would fail with Array#sort_by! not being defined. Change-Id: I39c998c7f788c2fee0f9940824fba4ede3cda52b Reviewed-on: https://gerrit.instructure.com/17538 Tested-by: Jenkins <jenkins@instructure.com> Reviewed-by: Zach Pendleton <zachp@instructure.com> QA-Review: Zach Pendleton <zachp@instructure.com>
This commit is contained in:
parent
b78ab1c5bc
commit
ead5794075
|
@ -252,7 +252,7 @@ describe CalendarEventsApiController, :type => :integration do
|
|||
:controller => 'calendar_events_api', :action => 'index', :format => 'json',
|
||||
:context_codes => [@course.asset_string], :start_date => '2012-01-01', :end_date => '2012-01-31'})
|
||||
json.size.should eql 2
|
||||
json.sort_by! {|e| e['id']}
|
||||
json.sort! {|e1, e2| e1['id'] <=> e2['id']}
|
||||
|
||||
e1json = json.first
|
||||
e1json.keys.sort.should eql(expected_slot_fields)
|
||||
|
@ -297,7 +297,7 @@ describe CalendarEventsApiController, :type => :integration do
|
|||
:controller => 'calendar_events_api', :action => 'index', :format => 'json',
|
||||
:context_codes => [group1.asset_string, group2.asset_string], :start_date => '2012-01-01', :end_date => '2012-01-31'})
|
||||
json.size.should eql 2
|
||||
json.sort_by! { |e| e['id'] }
|
||||
json.sort! {|e1, e2| e1['id'] <=> e2['id']}
|
||||
|
||||
ejson = json.first
|
||||
ejson.keys.sort.should eql((expected_slot_fields + ['reserved'] - ['child_events']).sort) # not reserved, so no child events can be seen
|
||||
|
@ -413,7 +413,7 @@ describe CalendarEventsApiController, :type => :integration do
|
|||
:controller => 'calendar_events_api', :action => 'index', :format => 'json',
|
||||
:context_codes => [ag1.asset_string, ag2.asset_string], :start_date => '2012-01-01', :end_date => '2012-01-31'})
|
||||
json.size.should eql 2
|
||||
json.sort_by! {|e| e['id']}
|
||||
json.sort! {|e1, e2| e1['id'] <=> e2['id']}
|
||||
json.each do |e|
|
||||
e.keys.sort.should eql((expected_slot_fields + ['reserved']).sort)
|
||||
e['reserved'].should be_true
|
||||
|
|
Loading…
Reference in New Issue