Add scores MIME type
refs PLAT-4154 Test Plan: Verify you can post results to the AGS using the application/vnd.ims.lis.v1.score+json content-type Change-Id: I2de0da013a93669b597aaac02070d2dac7ff207b Reviewed-on: https://gerrit.instructure.com/178409 Tested-by: Jenkins Reviewed-by: Marc Phillips <mphillips@instructure.com> QA-Review: Marc Phillips <mphillips@instructure.com> Product-Review: Weston Dransfield <wdransfield@instructure.com>
This commit is contained in:
parent
2ca967fb02
commit
3400a1e43f
|
@ -29,6 +29,7 @@ Mime::Type.register "application/rtf", :rtf
|
|||
Mime::Type.register "text/plaintext", :log
|
||||
Mime::Type.register 'application/vnd.api+json', :jsonapi
|
||||
Mime::Type.register 'application/vnd.ims.lis.v2.lineitem+json', :lineitem
|
||||
Mime::Type.register 'application/vnd.ims.lis.v1.score+json', :score
|
||||
Mime::Type.register 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', :docx
|
||||
Mime::Type.register 'application/vnd.openxmlformats-officedocument.presentationml.presentation', :pptx
|
||||
Mime::Type.register 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', :xlsx
|
||||
|
@ -40,6 +41,7 @@ MIME::Types['application/epub+zip'].each do |mime_type|
|
|||
end
|
||||
|
||||
# Custom LTI Advantage MIME types
|
||||
ActionDispatch::Request.parameter_parsers[:lineitem] = lambda do |body|
|
||||
JSON.parse(body)
|
||||
end
|
||||
standard_json_parser = lambda { |body| JSON.parse(body) }
|
||||
ActionDispatch::Request.parameter_parsers[:lineitem] = standard_json_parser
|
||||
ActionDispatch::Request.parameter_parsers[:score] = standard_json_parser
|
||||
|
||||
|
|
|
@ -63,6 +63,8 @@ module Lti::Ims
|
|||
let(:scope_to_remove) { 'https://purl.imsglobal.org/spec/lti-ags/scope/score' }
|
||||
|
||||
describe '#create' do
|
||||
let(:content_type) { 'application/vnd.ims.lis.v1.score+json' }
|
||||
|
||||
it_behaves_like 'advantage services'
|
||||
|
||||
context 'with valid params' do
|
||||
|
|
Loading…
Reference in New Issue