-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolves goal 2 of option 1 in the [Tech Spec](#16508) > 2. Enable application code to identify BEAAM appeals. ### Description Enables application code to identify BEAAM appeals. ### Acceptance Criteria - [ ] Code compiles correctly - [ ] `appeal.beaam?` returns `true` for all BEAAM appeals in Caseflow prod environment
- Loading branch information
Showing
3 changed files
with
37 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# frozen_string_literal: true | ||
|
||
# This concern is used to identify appeals associated with the BEAAM program. | ||
# Fulfills goal 2 of option 1 in the Tech Spec: Enable application code to identify BEAAM appeals. | ||
# See https://github.com/department-of-veterans-affairs/caseflow/wiki/BEAAM-Appeals | ||
# and Tech Spec https://github.com/department-of-veterans-affairs/caseflow/issues/16508 | ||
module BeaamAppealConcern | ||
extend ActiveSupport::Concern | ||
|
||
# Copied from https://github.com/department-of-veterans-affairs/caseflow/pull/8733/files | ||
BEAAM_CASE_IDS = [25, 26, 27, 28, 29, 30, 31, 32, 33, 34, | ||
36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, | ||
50, 51, | ||
53].freeze | ||
|
||
def beaam? | ||
BEAAM_CASE_IDS.include?(id) && Rails.env.production? | ||
end | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# frozen_string_literal: true | ||
|
||
describe BeaamAppealConcern do | ||
describe "#beaam?" do | ||
before { allow(Rails.env).to receive(:production?).and_return(true) } | ||
|
||
let(:appeal) { create(:appeal, id: 1) } | ||
subject { appeal.beaam? } | ||
context "non-BEAAM appeal" do | ||
it { is_expected.to eq false } | ||
end | ||
context "BEAAM appeal" do | ||
let(:appeal) { create(:appeal, id: BeaamAppealConcern::BEAAM_CASE_IDS.sample) } | ||
it { is_expected.to eq true } | ||
end | ||
end | ||
end |