-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only reopen judge assign tasks if attorney tasks are cancelled (#12491)
* Only reopen judge assign tasks if attorney tasks are cancelled * Add spec for attorney rewrite task * Update attorney_quality_review_task_spec.rb * Update attorney_rewrite_task_spec.rb * Update attorney_rewrite_task_spec.rb
- Loading branch information
1 parent
30add3b
commit bab4a7f
Showing
4 changed files
with
57 additions
and
4 deletions.
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
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# frozen_string_literal: true | ||
|
||
require "rails_helper" | ||
require "support/database_cleaner" | ||
require "support/vacols_database_cleaner" | ||
|
||
describe AttorneyRewriteTask, :all_dbs do | ||
context "when cancelling the task" do | ||
let(:atty) { create(:user) } | ||
let(:judge) { create(:user) } | ||
let!(:atty_staff) { create(:staff, :attorney_role, sdomainid: atty.css_id) } | ||
let!(:judge_staff) { create(:staff, :judge_role, sdomainid: judge.css_id) } | ||
let(:parent) { create(:ama_judge_decision_review_task) } | ||
let!(:task) do | ||
create(:ama_attorney_rewrite_task, assigned_by: judge, assigned_to: atty, parent: parent) | ||
end | ||
|
||
subject { task.update!(status: Constants.TASK_STATUSES.cancelled) } | ||
|
||
it "cancels the task and moves the parent back to the judge's queue" do | ||
expect(subject).to be true | ||
expect(task.reload.status).to eq Constants.TASK_STATUSES.cancelled | ||
expect(parent.reload.status).to eq Constants.TASK_STATUSES.assigned | ||
end | ||
end | ||
end |