Fix flakey group spec

Test Plan:
Modified specs pass regardless of id array order

Change-Id: I2f702a4878c6d64f9966d0cbf07ddbaca32a5705
Reviewed-on: https://gerrit.instructure.com/143476
Reviewed-by: Stewie aka Nicholas Stewart <nstewart@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Tested-by: Jenkins
Product-Review: Weston Dransfield <wdransfield@instructure.com>
This commit is contained in:
wdransfield 2018-03-13 14:58:36 -06:00 committed by Weston Dransfield
parent 259999f72f
commit 068bdbce26
1 changed files with 4 additions and 2 deletions

View File

@ -824,7 +824,8 @@ module Lti
it 'has substitution' do it 'has substitution' do
exp_hash = {test: '$com.instructure.Course.groupIds'} exp_hash = {test: '$com.instructure.Course.groupIds'}
variable_expander.expand_variables!(exp_hash) variable_expander.expand_variables!(exp_hash)
expect(exp_hash[:test]).to eq [group_two, group_one].map(&:id).join(',') expected_ids = [group_one, group_two].map { |g| g.id.to_s }
expect(exp_hash[:test].split(',')).to match_array expected_ids
end end
it 'does not include groups outside of the course' do it 'does not include groups outside of the course' do
@ -833,7 +834,8 @@ module Lti
second_course.groups.create!(name: 'Group Three') second_course.groups.create!(name: 'Group Three')
exp_hash = {test: '$com.instructure.Course.groupIds'} exp_hash = {test: '$com.instructure.Course.groupIds'}
variable_expander.expand_variables!(exp_hash) variable_expander.expand_variables!(exp_hash)
expect(exp_hash[:test]).to eq [group_two, group_one].map(&:id).join(',') expected_ids = [group_two, group_one].map { |g| g.id.to_s }
expect(exp_hash[:test].split(',')).to match_array expected_ids
end end
it 'only includes active group ids' do it 'only includes active group ids' do