Skip to content

Commit

Permalink
Makes LegacyAppeals never dispatch blocking
Browse files Browse the repository at this point in the history
  • Loading branch information
lomky committed Aug 25, 2020
1 parent 96aac68 commit a48c335
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 5 deletions.
2 changes: 2 additions & 0 deletions app/models/task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,8 @@ def reassign_clears_overtime?
end

def blocking_dispatch?
return false if appeal_type == "LegacyAppeal"

self.class.blocking_dispatch?
end

Expand Down
32 changes: 27 additions & 5 deletions spec/models/task_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1702,14 +1702,36 @@ def next_assignee(_options = {})
end

describe ".blocking_dispatch?" do
let(:appeal) { create(:appeal) }
let(:task) { create(:task, appeal: appeal) }

before { FeatureToggle.enable!(:block_at_dispatch) }
after { FeatureToggle.disable!(:block_at_dispatch) }

it "does not block dispatch" do
expect(task.blocking_dispatch?).to be(false)
context "on AMA appeals" do
let(:appeal) { create(:appeal) }

context "a non-blocking task" do
let(:task) { create(:task, appeal: appeal) }

it "does not block dispatch" do
expect(task.blocking_dispatch?).to be(false)
end
end

context "a blocking task" do
let(:task) { create(:congressional_interest_mail_task, appeal: appeal) }

it "blocks dispatch" do
expect(task.blocking_dispatch?).to be(true)
end
end
end

context "on legacy appeals, a normally blocking task" do
let(:appeal) { create(:legacy_appeal) }
let(:task) { create(:congressional_interest_mail_task, appeal: appeal) }

it "does not block dispatch" do
expect(task.blocking_dispatch?).to be(false)
end
end

context "for dispatch blocking types" do
Expand Down

0 comments on commit a48c335

Please sign in to comment.