Remove workflow_state from files API json response

Fixes: DIG-189

Test plan:
- Specs pass
- workflow_state is no longer in the files API response

Change-Id: I10060366d38cf1926a77858aefa1a3ffce6cb026
Reviewed-on: https://gerrit.instructure.com/213397
Reviewed-by: Joshua Orr <jgorr@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Joshua Orr <jgorr@instructure.com>
This commit is contained in:
Nick Houle 2019-10-16 13:20:41 -06:00
parent 977abf7323
commit 4f89ef6bd8
6 changed files with 0 additions and 15 deletions

View File

@ -43,7 +43,6 @@ module Api::V1::Attachment
'folder_id' => attachment.folder_id,
'display_name' => attachment.display_name,
'filename' => attachment.filename,
'workflow_state' => attachment.workflow_state,
'upload_status' => AttachmentUploadStatus.upload_status(attachment)
}
return hash if options[:only] && options[:only].include?('names')

View File

@ -48,7 +48,6 @@ shared_examples_for "file uploads api" do
'content-type' => attachment.content_type,
'display_name' => attachment.display_name,
'filename' => attachment.filename,
'workflow_state' => "processed",
'upload_status' => "success",
'size' => attachment.size,
'unlock_at' => attachment.unlock_at ? attachment.unlock_at.as_json : nil,
@ -115,7 +114,6 @@ shared_examples_for "file uploads api" do
'content-type' => attachment.content_type,
'display_name' => attachment.display_name,
'filename' => attachment.filename,
'workflow_state' => "processed",
'size' => tmpfile.size,
'unlock_at' => nil,
'locked' => false,

View File

@ -987,7 +987,6 @@ describe ConversationsController, type: :request do
"id" => forwarded_message.id, "created_at" => forwarded_message.created_at.to_json[1, 20], "body" => "test", "author_id" => @bob.id, "generated" => false, "media_comment" => nil, "forwarded_messages" => [],
"attachments" => [{
'filename' => attachment.filename,
'workflow_state' => 'processed',
'url' => "http://www.example.com/files/#{attachment.id}/download?download_frd=1&verifier=#{attachment.uuid}",
'content-type' => 'image/png',
'display_name' => 'test my file? hai!&.png',
@ -1250,7 +1249,6 @@ describe ConversationsController, type: :request do
"attachments" => [
{
"filename" => "test.txt",
"workflow_state" => "processed",
"url" => "http://www.example.com/files/#{attachment.id}/download?download_frd=1&verifier=#{attachment.uuid}",
"content-type" => "unknown/unknown",
"display_name" => "test.txt",

View File

@ -378,7 +378,6 @@ describe DiscussionTopicsController, type: :request do
"url" => "http://www.example.com/files/#{@attachment.id}/download?download_frd=1&verifier=#{@attachment.uuid}",
"filename" => "content.txt",
"display_name" => "content.txt",
"workflow_state" => "processed",
"id" => @attachment.id,
"uuid" => @attachment.uuid,
"folder_id" => @attachment.folder_id,
@ -1506,7 +1505,6 @@ describe DiscussionTopicsController, type: :request do
"url" => "http://www.example.com/files/#{attachment.id}/download?download_frd=1&verifier=#{attachment.uuid}",
"filename" => "content.txt",
"display_name" => "content.txt",
"workflow_state" => "processed",
"id" => attachment.id,
"uuid" => attachment.uuid,
"folder_id" => attachment.folder_id,
@ -2587,7 +2585,6 @@ describe DiscussionTopicsController, type: :request do
"url" => "http://www.example.com/files/#{@attachment.id}/download?download_frd=1&verifier=#{@attachment.uuid}",
"filename" => "unknown.loser",
"display_name" => "unknown.loser",
"workflow_state" => "pending_upload",
"id" => @attachment.id,
"uuid" => @attachment.uuid,
"folder_id" => @attachment.folder_id,

View File

@ -150,7 +150,6 @@ describe "Files API", type: :request do
'url' => file_download_url(@attachment, :verifier => @attachment.uuid, :download => '1', :download_frd => '1'),
'content-type' => 'text/plain',
'display_name' => 'test.txt',
'workflow_state' => 'processed',
'filename' => @attachment.filename,
'size' => @attachment.size,
'unlock_at' => nil,
@ -190,7 +189,6 @@ describe "Files API", type: :request do
'url' => file_download_url(@attachment, :verifier => @attachment.uuid, :download => '1', :download_frd => '1'),
'content-type' => 'text/plain',
'display_name' => 'test.txt',
'workflow_state' => 'processed',
'filename' => @attachment.filename,
'size' => @attachment.size,
'unlock_at' => nil,
@ -892,7 +890,6 @@ describe "Files API", type: :request do
'url' => file_download_url(@att, :verifier => @att.uuid, :download => '1', :download_frd => '1'),
'content-type' => "image/png",
'display_name' => 'test-frd.png',
'workflow_state' => 'processed',
'filename' => @att.filename,
'size' => @att.size,
'unlock_at' => nil,

View File

@ -1097,7 +1097,6 @@ describe 'Submissions API', type: :request do
"url" => "http://www.example.com/files/#{sub1.attachments.first.id}/download?download_frd=1&verifier=#{sub1.attachments.first.uuid}",
"filename" => "unknown.loser",
"display_name" => "unknown.loser",
"workflow_state" => "pending_upload",
"upload_status" => "success",
"id" => sub1.attachments.first.id,
"uuid" => sub1.attachments.first.uuid,
@ -1198,7 +1197,6 @@ describe 'Submissions API', type: :request do
"url" => "http://www.example.com/files/#{sub1.attachments.first.id}/download?download_frd=1&verifier=#{sub1.attachments.first.uuid}",
"filename" => "unknown.loser",
"display_name" => "unknown.loser",
"workflow_state" => "pending_upload",
"upload_status" => "success",
"id" => sub1.attachments.first.id,
"uuid" => sub1.attachments.first.uuid,
@ -1313,7 +1311,6 @@ describe 'Submissions API', type: :request do
{"content-type" => "image/png",
"display_name" => "snapshot.png",
"filename" => "snapshot.png",
"workflow_state" => "pending_upload",
"upload_status" => "success",
"url" => "http://www.example.com/files/#{sub2a1.id}/download?download_frd=1&verifier=#{sub2a1.uuid}",
"id" => sub2a1.id,
@ -1352,7 +1349,6 @@ describe 'Submissions API', type: :request do
[{"content-type" => "image/png",
"display_name" => "snapshot.png",
"filename" => "snapshot.png",
"workflow_state" => "pending_upload",
"upload_status" => "success",
"url" => "http://www.example.com/files/#{sub2a1.id}/download?download_frd=1&verifier=#{sub2a1.uuid}",
"id" => sub2a1.id,