add user object to sis import api
fixes CNVS-39635 test plan - sis import api should return user Change-Id: If54a50a646c8b73ebf122885d53717572930dda7 Reviewed-on: https://gerrit.instructure.com/128018 Tested-by: Jenkins Reviewed-by: James Williams <jamesw@instructure.com> Reviewed-by: Cody Cutrer <cody@instructure.com> QA-Review: Jeremy Putnam <jeremyp@instructure.com> Product-Review: Rob Orton <rob@instructure.com>
This commit is contained in:
parent
b5889a957c
commit
1ca32c4057
|
@ -173,6 +173,10 @@
|
|||
# "items": {"type": "string"}
|
||||
# }
|
||||
# },
|
||||
# "user": {
|
||||
# "description": "The user that initiated the sis_batch. See the Users API for details.",
|
||||
# "$ref": "User"
|
||||
# },
|
||||
# "processing_errors": {
|
||||
# "description": "An array of CSV_file/error_message pairs.",
|
||||
# "example": [["students.csv","Error while importing CSV. Please contact support."]],
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
module Api::V1::SisImport
|
||||
include Api::V1::Json
|
||||
include Api::V1::Attachment
|
||||
include Api::V1::User
|
||||
|
||||
def sis_imports_json(batches, user, session)
|
||||
batches.map do |f|
|
||||
|
@ -39,6 +40,7 @@ module Api::V1::SisImport
|
|||
{submission_attachment: true}
|
||||
)
|
||||
end
|
||||
json[:user] = user_json(batch.user, user, session) if batch.user
|
||||
json
|
||||
end
|
||||
end
|
||||
|
|
|
@ -58,6 +58,7 @@ describe SisImportsApiController, type: :request do
|
|||
expect(json["batch_mode_term_id"]).not_to be_nil
|
||||
end
|
||||
json.delete("batch_mode_term_id")
|
||||
json.delete("user")
|
||||
batch = SisBatch.last
|
||||
expect(json).to eq({
|
||||
"data" => { "import_type"=>"instructure_csv"},
|
||||
|
@ -97,6 +98,7 @@ describe SisImportsApiController, type: :request do
|
|||
json.delete("ended_at")
|
||||
expect(json.has_key?("started_at")).to eq true
|
||||
json.delete("started_at")
|
||||
json.delete("user")
|
||||
batch = SisBatch.last
|
||||
expect(json).to eq({
|
||||
"data" => { "import_type"=>"instructure_csv"},
|
||||
|
@ -133,6 +135,7 @@ describe SisImportsApiController, type: :request do
|
|||
json.delete("ended_at")
|
||||
expect(json.has_key?("started_at")).to eq true
|
||||
json.delete("started_at")
|
||||
json.delete("user")
|
||||
expect(json).to eq({
|
||||
"data" => { "import_type" => "instructure_csv",
|
||||
"supplied_batches" => ["user"],
|
||||
|
@ -645,6 +648,7 @@ describe SisImportsApiController, type: :request do
|
|||
json["sis_imports"].first.delete("updated_at")
|
||||
json["sis_imports"].first.delete("ended_at")
|
||||
json["sis_imports"].first.delete("started_at")
|
||||
json["sis_imports"].first.delete("user")
|
||||
|
||||
expect(json).to eq({"sis_imports"=>[{
|
||||
"data" => { "import_type" => "instructure_csv",
|
||||
|
|
Loading…
Reference in New Issue