Skip to content

Commit

Permalink
change test file
Browse files Browse the repository at this point in the history
  • Loading branch information
piedram committed Nov 27, 2024
1 parent 4a1cf76 commit 52cb254
Showing 1 changed file with 29 additions and 12 deletions.
41 changes: 29 additions & 12 deletions spec/controllers/tasks_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1668,16 +1668,33 @@
end
end

describe "PATH tasks/:id/modal/upload_transcription_vbms" do
describe "PATH tasks/:id/modal/error_found_upload_transcription_to_vbms" do
let(:file_type) { "pdf" }
let(:hearing) { create(:hearing) }
let(:docket_number) { hearing.docket_number }
let(:appeal_id) { hearing.appeal.uuid }
let(:file_name) { "#{docket_number}_#{hearing.id}_#{hearing.class}.#{file_type}" }
let(:tmp_location) { File.join(Rails.root, "tmp", "transcription_files", file_type, file_name) }
let!(:create_transcription_task) do
Hearings::TranscriptionFile.create!(
hearing_id: hearing.id,
hearing_type: "Hearing",
file_name: file_name,
file_type: file_type.to_s,
docket_number: hearing.docket_number,
file_status: "Successful upload (AWS)",
date_upload_aws: Time.zone.today,
aws_link: "vaec-appeals-caseflow-test/transcript_pdf/#{file_name}"
)
end
let(:transcription_file) { Hearings::TranscriptionFile.find_by(file_name: file_name) }
let(:user) { create(:default_user) }
let!(:veteran) { create(:veteran) }
let!(:appeal) { create(:appeal, veteran: veteran) }
let(:root_task) { create(:root_task, appeal: appeal) }
let(:root_task) { create(:root_task, appeal: hearing.appeal) }
let(:distribution_task) { create(:distribution_task, parent: root_task) }
let(:parent_hearing_task) { create(:hearing_task, parent: distribution_task) }
let!(:review_transcript_task) do
ReviewTranscriptTask.create!(
appeal: appeal,
appeal: hearing.appeal,
parent: root_task,
assigned_to: user
)
Expand All @@ -1688,23 +1705,23 @@
task: {
instructions: "testing"
},
id: review_transcript_task.id.to_s
id: review_transcript_task.id.to_s,
file_info: {
file: "dGhpcyBpcyBhIHRlc3QgZmlsZQ==",
file_name: file_name
}
}
end

before do
review_transcript_task.update!(status: Constants.TASK_STATUSES.in_progress)
end

subject { patch :upload_transcription_to_vbms, params: params }
subject { patch :error_found_upload_transcription_to_vbms, params: params }

it "updates status to completed" do
it "updates status for ReviewTranscriptTask to completed" do
subject
expect(response.status).to eq 200
response_body = JSON.parse(response.body)["tasks"]
expect(response_body.last["attributes"]["status"]).to eq Constants.TASK_STATUSES.completed
expect(response_body.last["attributes"]["instructions"][0]).to eq(COPY::REVIEW_TRANSCRIPT_TASK_DEFAULT_INSTRUCTIONS)
expect(response_body.last["attributes"]["closed_at"]).to_not be nil
end
end
end

0 comments on commit 52cb254

Please sign in to comment.