230230 expect ( hash [ 'tool_consumer_instance_guid' ] ) . to eq 'root_account_lti_guid' #was hash['tool_consumer_instance_guid']).to eq sub_account.root_account.lti_guid
231231 end
232232
233- it 'does not include URI query parameters' do
233+ it 'includes URI query parameters' do
234234 hash = LtiOutbound ::ToolLaunch . new ( :url => 'http://www.yahoo.com?paramater_a=value_a¶meter_b=value_b' ,
235235 :tool => tool ,
236236 :user => user ,
239239 :link_code => '123456' ,
240240 :return_url => 'http://www.google.com' ,
241241 :variable_expander => variable_expander ) . generate
242- expect ( hash . key? ( 'paramater_a' ) ) . to be false
243- expect ( hash . key? ( 'parameter_b' ) ) . to be false
242+ expect ( hash [ 'paramater_a' ] ) . to eq 'value_a'
243+ expect ( hash [ 'parameter_b' ] ) . to eq 'value_b'
244244 end
245245
246246 it 'does not allow overwriting other parameters from the URI query string' do
259259 it 'includes custom fields' do
260260 tool . privacy_level = LtiOutbound ::LTITool ::PRIVACY_LEVEL_ANONYMOUS
261261 tool . settings = { :custom_fields => {
262- 'custom_bob' => 'bob' ,
263- 'custom_fred' => 'fred' ,
264- 'john' => 'john' ,
265- '@$TAA$#$#' => 123 } }
262+ 'custom_bob' => 'bob' ,
263+ 'custom_fred' => 'fred' ,
264+ 'john' => 'john' ,
265+ '@$TAA$#$#' => 123 } }
266266 hash = tool_launch . generate
267267 expect ( hash . keys . select { |k | k . match ( /^custom_/ ) } . sort ) . to eq (
268- [ 'custom___taa____' , 'custom_bob' , 'custom_canvas_enrollment_state' , 'custom_fred' , 'custom_john' ] )
268+ [ 'custom___taa____' , 'custom_bob' , 'custom_canvas_enrollment_state' , 'custom_fred' , 'custom_john' ] )
269269 expect ( hash [ 'custom_bob' ] ) . to eql ( 'bob' )
270270 expect ( hash [ 'custom_fred' ] ) . to eql ( 'fred' )
271271 expect ( hash [ 'custom_john' ] ) . to eql ( 'john' )
@@ -390,20 +390,20 @@ def explicit_signature_settings(timestamp, nonce)
390390 explicit_signature_settings ( '1251600739' , 'c8350c0e47782d16d2fa48b2090c1d8f' )
391391
392392 hash = LtiOutbound ::ToolLaunch . send ( :generate_params , {
393- :resource_link_id => '120988f929-274612' ,
394- :user_id => '292832126' ,
395- :roles => 'Instructor' ,
396- :lis_person_name_full => 'Jane Q. Public' ,
397- :lis_person_contact_email_primary => 'user@school.edu' ,
398- :lis_person_sourced_id => 'school.edu:user' ,
399- :context_id => '456434513' ,
400- :context_title => 'Design of Personal Environments' ,
401- :context_label => 'SI182' ,
402- :lti_version => 'LTI-1p0' ,
403- :lti_message_type => 'basic-lti-launch-request' ,
404- :tool_consumer_instance_guid => 'lmsng.school.edu' ,
405- :tool_consumer_instance_description => 'University of School (LMSng)' ,
406- :lti_submit => 'Launch Endpoint with LTI Data'
393+ :resource_link_id => '120988f929-274612' ,
394+ :user_id => '292832126' ,
395+ :roles => 'Instructor' ,
396+ :lis_person_name_full => 'Jane Q. Public' ,
397+ :lis_person_contact_email_primary => 'user@school.edu' ,
398+ :lis_person_sourced_id => 'school.edu:user' ,
399+ :context_id => '456434513' ,
400+ :context_title => 'Design of Personal Environments' ,
401+ :context_label => 'SI182' ,
402+ :lti_version => 'LTI-1p0' ,
403+ :lti_message_type => 'basic-lti-launch-request' ,
404+ :tool_consumer_instance_guid => 'lmsng.school.edu' ,
405+ :tool_consumer_instance_description => 'University of School (LMSng)' ,
406+ :lti_submit => 'Launch Endpoint with LTI Data'
407407 } , 'http://dr-chuck.com/ims/php-simple/tool.php' , '12345' , 'secret' )
408408
409409 expect ( hash [ 'oauth_signature' ] ) . to eql ( 'l1ZTsn1HjGXzqeaTQMPbjrqvjLU=' )
@@ -412,23 +412,23 @@ def explicit_signature_settings(timestamp, nonce)
412412 it 'generate a correct signature with URL query parameters' do
413413 explicit_signature_settings ( '1251600739' , 'c8350c0e47782d16d2fa48b2090c1d8f' )
414414 hash = LtiOutbound ::ToolLaunch . send ( :generate_params , {
415- :resource_link_id => '120988f929-274612' ,
416- :user_id => '292832126' ,
417- :roles => 'Instructor' ,
418- :lis_person_name_full => 'Jane Q. Public' ,
419- :lis_person_contact_email_primary => 'user@school.edu' ,
420- :lis_person_sourced_id => 'school.edu:user' ,
421- :context_id => '456434513' ,
422- :context_title => 'Design of Personal Environments' ,
423- :context_label => 'SI182' ,
424- :lti_version => 'LTI-1p0' ,
425- :lti_message_type => 'basic-lti-launch-request' ,
426- :tool_consumer_instance_guid => 'lmsng.school.edu' ,
427- :tool_consumer_instance_description => 'University of School (LMSng)' ,
428- :lti_submit => 'Launch Endpoint with LTI Data'
415+ :resource_link_id => '120988f929-274612' ,
416+ :user_id => '292832126' ,
417+ :roles => 'Instructor' ,
418+ :lis_person_name_full => 'Jane Q. Public' ,
419+ :lis_person_contact_email_primary => 'user@school.edu' ,
420+ :lis_person_sourced_id => 'school.edu:user' ,
421+ :context_id => '456434513' ,
422+ :context_title => 'Design of Personal Environments' ,
423+ :context_label => 'SI182' ,
424+ :lti_version => 'LTI-1p0' ,
425+ :lti_message_type => 'basic-lti-launch-request' ,
426+ :tool_consumer_instance_guid => 'lmsng.school.edu' ,
427+ :tool_consumer_instance_description => 'University of School (LMSng)' ,
428+ :lti_submit => 'Launch Endpoint with LTI Data'
429429 } , 'http://dr-chuck.com/ims/php-simple/tool.php?a=1&b=2&c=3%20%26a' , '12345' , 'secret' )
430- expect ( hash [ 'oauth_signature' ] ) . to eql ( 'l1ZTsn1HjGXzqeaTQMPbjrqvjLU =' )
431- expect ( hash . key? ( 'c' ) ) . to be false
430+ expect ( hash [ 'oauth_signature' ] ) . to eql ( 'k/+aMdax1Jm5kuGF6DG/ptN5VfY =' )
431+ expect ( hash [ 'c' ] ) . to eq '3 &a'
432432 end
433433
434434 it 'generate a correct signature with a non-standard port' do
@@ -463,4 +463,4 @@ def explicit_signature_settings(timestamp, nonce)
463463 expect ( hash [ 'oauth_signature' ] ) . to eql ( 'X8Aq2HXSHnr6u/6z/G9zI5aDoR0=' )
464464 end
465465 end
466- end
466+ end
0 commit comments