From 13c2d0b7d2152433f33caec018168d6e23481ea4 Mon Sep 17 00:00:00 2001 From: Andrew Huff Date: Thu, 4 Jan 2018 13:56:43 -0500 Subject: [PATCH] add root account id to instfs preflight json closes RECNVS-38 test plan: none (this commit will be tested as a part of RECNVS-39) Change-Id: I39c39974c8f9553af5057e159c419cd84397caf8 Reviewed-on: https://gerrit.instructure.com/136940 Tested-by: Jenkins Reviewed-by: Jacob Fugal QA-Review: Collin Parrish Product-Review: Andrew Huff --- lib/inst_fs.rb | 1 + spec/lib/inst_fs_spec.rb | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/inst_fs.rb b/lib/inst_fs.rb index b6ff5ebca46..43d49c69c7e 100644 --- a/lib/inst_fs.rb +++ b/lib/inst_fs.rb @@ -55,6 +55,7 @@ module InstFS context_id: context.global_id.to_s, user_id: user.global_id.to_s, folder_id: folder && folder.global_id.to_s, + root_account_id: context.account.root_account.global_id.to_s, quota_exempt: !!quota_exempt, on_duplicate: on_duplicate) diff --git a/spec/lib/inst_fs_spec.rb b/spec/lib/inst_fs_spec.rb index e048427bac1..dd78c1f2fb8 100644 --- a/spec/lib/inst_fs_spec.rb +++ b/spec/lib/inst_fs_spec.rb @@ -110,7 +110,7 @@ describe InstFS do end context "upload_preflight_json" do - let(:context) { instance_double("Course", id: 1, global_id: 101) } + let(:context) { instance_double("Course", id: 1, global_id: 101, account: Account.default) } let(:user) { instance_double("User", id: 2, global_id: 102) } let(:folder) { instance_double("Folder", id: 3, global_id: 103) } let(:filename) { 'test.txt' } @@ -181,6 +181,10 @@ describe InstFS do expect(capture_params['folder_id']).to eq folder.global_id.to_s end + it "include the root_account_id" do + expect(capture_params['root_account_id']).to eq context.account.root_account.global_id.to_s + end + it "include the quota_exempt flag" do expect(capture_params['quota_exempt']).to eq quota_exempt end