Last active
January 24, 2020 16:15
-
-
Save lomky/0653b27d528ac975ac3ce4757bb1bca8 to your computer and use it in GitHub Desktop.
Demo of the existing Appeals with Realistic Task Tree traits for Caseflow. Throw in the `spec/` dir and run like a normal test. Output formatting slightly wonky because I wrote it fast ¯\_(ツ)_/¯
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
feature "2020-JAN-24 Appeals with Task Trees Demo", :all_dbs do | |
let(:judge_user) { create(:user) } | |
let!(:vacols_judge) { create(:staff, :judge_role, sdomainid: judge_user.css_id) } | |
let(:judge_team) { JudgeTeam.create_for_judge(judge_user) } | |
let(:attorney_user) { create(:user) } | |
let!(:attorney_staff) { create(:staff, :attorney_role, user: attorney_user) } | |
let!(:attorney_on_judge_team) { judge_team.add_user(attorney_user) } | |
let(:veteran_first_name) { "Dorothy" } | |
let(:veteran_last_name) { "Slezak" } | |
let(:veteran_full_name) { "#{veteran_first_name} #{veteran_last_name}" } | |
let!(:veteran) { create(:veteran, first_name: veteran_first_name, last_name: veteran_last_name, file_number: "989898989") } | |
let!(:appeal_post_intake_dr) do | |
create( | |
:appeal, | |
:with_post_intake_tasks, | |
docket_type: Constants.AMA_DOCKETS.direct_review, | |
associated_judge: judge_user, | |
associated_attorney: attorney_user, | |
veteran: veteran, | |
request_issues: build_list( | |
:request_issue, 1, | |
contested_issue_description: "Tinnitus" | |
) | |
) | |
end | |
let!(:appeal_post_intake_h) do | |
create( | |
:appeal, | |
:with_post_intake_tasks, | |
docket_type: Constants.AMA_DOCKETS.hearing, | |
associated_judge: judge_user, | |
associated_attorney: attorney_user, | |
veteran: veteran, | |
request_issues: build_list( | |
:request_issue, 1, | |
contested_issue_description: "Tinnitus" | |
) | |
) | |
end | |
let!(:appeal_post_intake_es) do | |
create( | |
:appeal, | |
:with_post_intake_tasks, | |
docket_type: Constants.AMA_DOCKETS.evidence_submission, | |
associated_judge: judge_user, | |
associated_attorney: attorney_user, | |
veteran: veteran, | |
request_issues: build_list( | |
:request_issue, 1, | |
contested_issue_description: "Tinnitus" | |
) | |
) | |
end | |
let!(:appeal_ready_to_distribute) do | |
create( | |
:appeal, | |
:ready_for_distribution, | |
docket_type: Constants.AMA_DOCKETS.direct_review, | |
associated_judge: judge_user, | |
associated_attorney: attorney_user, | |
veteran: veteran, | |
request_issues: build_list( | |
:request_issue, 1, | |
contested_issue_description: "Tinnitus" | |
) | |
) | |
end | |
let!(:appeal_assigned_to_judge) do | |
create( | |
:appeal, | |
:assigned_to_judge, | |
docket_type: Constants.AMA_DOCKETS.direct_review, | |
associated_judge: judge_user, | |
associated_attorney: attorney_user, | |
veteran: veteran, | |
request_issues: build_list( | |
:request_issue, 1, | |
contested_issue_description: "Tinnitus" | |
) | |
) | |
end | |
let!(:appeal_at_drafting) do | |
create( | |
:appeal, | |
:at_attorney_drafting, | |
docket_type: Constants.AMA_DOCKETS.direct_review, | |
associated_judge: judge_user, | |
associated_attorney: attorney_user, | |
veteran: veteran, | |
request_issues: build_list( | |
:request_issue, 1, | |
contested_issue_description: "Tinnitus" | |
) | |
) | |
end | |
let!(:appeal_assigned_to_judge_h) do | |
create( | |
:appeal, | |
:assigned_to_judge, | |
docket_type: Constants.AMA_DOCKETS.hearing, | |
associated_judge: judge_user, | |
associated_attorney: attorney_user, | |
veteran: veteran, | |
request_issues: build_list( | |
:request_issue, 1, | |
contested_issue_description: "Tinnitus" | |
) | |
) | |
end | |
let!(:appeal_at_drafting_es) do | |
create( | |
:appeal, | |
:at_attorney_drafting, | |
docket_type: Constants.AMA_DOCKETS.evidence_submission, | |
associated_judge: judge_user, | |
associated_attorney: attorney_user, | |
veteran: veteran, | |
request_issues: build_list( | |
:request_issue, 1, | |
contested_issue_description: "Tinnitus" | |
) | |
) | |
end | |
context "# Appeal factory traits that exist already #" do | |
context "## Appeal with post-intake tasks - Thanks Peter!" do | |
it " " do | |
puts | |
puts "> Direct Review docket, post intake" | |
puts appeal_post_intake_dr.structure_render(:id, :status, :assigned_to_id) | |
end | |
it " " do | |
puts | |
puts "> Hearing docket, post intake" | |
puts appeal_post_intake_h.structure_render(:id, :status, :assigned_to_id) | |
end | |
it " " do | |
puts | |
puts "> Evidence Submission docket, post intake" | |
puts appeal_post_intake_es.structure_render(:id, :status, :assigned_to_id) | |
end | |
end | |
context "## Appeal ready for distribution - courtesy of Moncef!" do | |
it " " do | |
puts | |
puts "> Direct Review docket, Ready for Distribution" | |
puts appeal_ready_to_distribute.structure_render(:id, :status, :assigned_to_id) | |
end | |
end | |
context "## Appeal distributed to a Judge - I wrote last ~Aug" do | |
it " " do | |
puts | |
puts "> Direct Review docket, distributed to judge (aka assigned to judge)" | |
puts appeal_assigned_to_judge.structure_render(:id, :status, :assigned_to_id) | |
end | |
end | |
end | |
context "# New appeal factory trait #" do | |
context "## Appeal assigned to Attorney to be drafted" do | |
it " " do | |
puts | |
puts "> Direct Review docket, at decision drafting (aka assigned to attorney)" | |
puts appeal_at_drafting.structure_render(:id, :status, :assigned_to_id) | |
end | |
end | |
end | |
context "# creatable but wonky trees - use with caution, and consider implementing! #" do | |
context "can create Hearings & Evidence Submission appeals at the Ready to distribute, Assigned to judge, or at Attorney drafting, but" do | |
it " " do | |
puts | |
puts "> Hearing docket, assigned to judge - has incorrectly open hearing tasks" | |
puts appeal_assigned_to_judge_h.structure_render(:id, :status, :assigned_to_id) | |
puts | |
puts "> Evidence submission docket, at attorney drafting - has incorrectly open evidence submission tasks" | |
puts appeal_at_drafting_es.structure_render(:id, :status, :assigned_to_id) | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment