-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Only send AttorneyTasks back to judge assign #15493
Merged
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -416,7 +416,7 @@ def self.find_first_task_or_create(appeal, task_type) | |
parent { create(:ama_judge_decision_review_task, appeal: appeal) } | ||
end | ||
|
||
factory :ama_judge_dispatch_return_to_attorney_task, class: AttorneyDispatchReturnTask do | ||
factory :ama_attorney_dispatch_return_task, class: AttorneyDispatchReturnTask do | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sneaky rename |
||
parent { create(:ama_judge_decision_review_task, appeal: appeal) } | ||
end | ||
|
||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -151,14 +151,17 @@ | |
context ".update_from_params" do | ||
let(:judge) { create(:user, :with_vacols_judge_record) } | ||
let(:attorney) { create(:user, :with_vacols_attorney_record) } | ||
let(:judge_task) { create(:ama_judge_decision_review_task, assigned_to: judge) } | ||
let(:attorney_task) do | ||
create(:ama_attorney_task, assigned_to: attorney, assigned_by: judge, parent: judge_task) | ||
end | ||
let(:judge_task_type) { :ama_judge_decision_review_task } | ||
let(:attorney_task_type) { :ama_attorney_task } | ||
let(:judge_task) { create(judge_task_type, assigned_to: judge) } | ||
let(:attorney_task) { create(attorney_task_type, assigned_to: attorney, assigned_by: judge, parent: judge_task) } | ||
let(:params) { { status: Constants.TASK_STATUSES.completed } } | ||
|
||
subject { attorney_task.update_from_params(params, attorney) } | ||
|
||
context "when cancellation params are not provided" do | ||
it "does not send_back_to_judge_assign!" do | ||
tasks = attorney_task.update_from_params({ status: Constants.TASK_STATUSES.completed }, attorney) | ||
tasks = subject | ||
|
||
expect(tasks.first.type).to eq AttorneyTask.name | ||
expect(tasks.first.status).to eq Constants.TASK_STATUSES.completed | ||
|
@@ -169,8 +172,10 @@ | |
end | ||
|
||
context "when cancellation params are provided" do | ||
let(:params) { { status: Constants.TASK_STATUSES.cancelled } } | ||
|
||
it "calls send_back_to_judge_assign!" do | ||
tasks = attorney_task.update_from_params({ status: Constants.TASK_STATUSES.cancelled }, attorney) | ||
tasks = subject | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. General refactoring |
||
|
||
expect(tasks.first.type).to eq AttorneyTask.name | ||
expect(tasks.first.status).to eq Constants.TASK_STATUSES.cancelled | ||
|
@@ -184,6 +189,21 @@ | |
expect(tasks.third.status).to eq Constants.TASK_STATUSES.assigned | ||
expect(tasks.third.assigned_to).to eq judge | ||
end | ||
|
||
context "when the task is an attorney task subtype" do | ||
let(:judge_task_type) { :ama_judge_dispatch_return_task } | ||
let(:attorney_task_type) { :ama_attorney_dispatch_return_task } | ||
|
||
it "does not send_back_to_judge_assign!" do | ||
tasks = subject | ||
|
||
expect(tasks.first.type).to eq AttorneyDispatchReturnTask.name | ||
expect(tasks.first.status).to eq Constants.TASK_STATUSES.cancelled | ||
expect(tasks.first.closed_at).to_not be nil | ||
|
||
expect(tasks.first.parent.status).to eq Constants.TASK_STATUSES.assigned | ||
end | ||
end | ||
end | ||
end | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change! Only AttyTasks go back to judge assign, not subclasses