Skip to content
This repository is currently being migrated. It's locked while the migration is in progress.

Commit 58989d3

Browse files
authored
[Mobile] Update cc referral filtering for primary care (#27785)
1 parent a97047b commit 58989d3

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

modules/mobile/app/controllers/mobile/v0/referrals_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
module Mobile
44
module V0
55
class ReferralsController < ApplicationController
6-
SUPPORTED_CATEGORIES_OF_CARE = %w[optometry].freeze
6+
SUPPORTED_CATEGORIES_OF_CARE = ['primary care'].freeze
77

88
def index
99
StatsD.increment('mobile.referrals.index.total')

modules/mobile/spec/controllers/mobile/v0/referrals_controller_spec.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
let(:controller) { described_class.new }
77

88
describe '#filter_by_category_of_care' do
9-
let(:optometry_referral) { build(:ccra_referral_list_entry, category_of_care: 'optometry') }
9+
let(:primary_care_referral) { build(:ccra_referral_list_entry, category_of_care: 'primary care') }
1010
let(:cardiology_referral) { build(:ccra_referral_list_entry, category_of_care: 'cardiology') }
1111
let(:nil_category_referral) { build(:ccra_referral_list_entry, category_of_care: nil) }
1212

13-
it 'keeps optometry referrals' do
14-
result = controller.send(:filter_by_category_of_care, [optometry_referral, cardiology_referral])
15-
expect(result).to contain_exactly(optometry_referral)
13+
it 'keeps primary care referrals' do
14+
result = controller.send(:filter_by_category_of_care, [primary_care_referral, cardiology_referral])
15+
expect(result).to contain_exactly(primary_care_referral)
1616
end
1717

1818
it 'filters out unsupported categories' do
@@ -26,7 +26,7 @@
2626
end
2727

2828
it 'is case insensitive' do
29-
upcased = build(:ccra_referral_list_entry, category_of_care: 'OPTOMETRY')
29+
upcased = build(:ccra_referral_list_entry, category_of_care: 'PRIMARY CARE')
3030
result = controller.send(:filter_by_category_of_care, [upcased])
3131
expect(result).to contain_exactly(upcased)
3232
end

modules/mobile/spec/requests/mobile/v0/referrals_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
end
1818

1919
describe 'GET /mobile/v0/referrals' do
20-
let(:referrals) { build_list(:ccra_referral_list_entry, 3, category_of_care: 'optometry') }
20+
let(:referrals) { build_list(:ccra_referral_list_entry, 3, category_of_care: 'primary care') }
2121

2222
before do
2323
allow(referral_service_double).to receive(:get_vaos_referral_list).and_return(referrals)
@@ -70,11 +70,11 @@
7070

7171
context 'when there are expired referrals' do
7272
let(:active_referral) do
73-
build(:ccra_referral_list_entry, category_of_care: 'optometry',
73+
build(:ccra_referral_list_entry, category_of_care: 'primary care',
7474
referral_expiration_date: (Date.current + 30.days).to_s)
7575
end
7676
let(:expired_referral) do
77-
build(:ccra_referral_list_entry, category_of_care: 'optometry',
77+
build(:ccra_referral_list_entry, category_of_care: 'primary care',
7878
referral_expiration_date: (Date.current - 1.day).to_s)
7979
end
8080

@@ -93,7 +93,7 @@
9393
end
9494

9595
context 'when there are referrals with unsupported categories of care' do
96-
let(:supported_referral) { build(:ccra_referral_list_entry, category_of_care: 'optometry') }
96+
let(:supported_referral) { build(:ccra_referral_list_entry, category_of_care: 'primary care') }
9797
let(:unsupported_referral) { build(:ccra_referral_list_entry, category_of_care: 'cardiology') }
9898

9999
before do

0 commit comments

Comments
 (0)