-
Notifications
You must be signed in to change notification settings - Fork 62
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
add facilities check on mobile appts #18486
Changes from 3 commits
2195c5e
a7fb76d
3ab7b03
483a04e
252af83
4832f30
be5c9b3
f7a2fb4
0ac997d
81c9606
a288b79
5490e4f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
errors: | ||
- title: 'Forbidden' | ||
detail: 'No facility associated with user' | ||
code: '403' | ||
status: '403' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
errors: | ||
- title: 'Forbidden' | ||
detail: 'No patient ICN found' | ||
code: '403' | ||
status: '403' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
errors: | ||
- title: 'Forbidden' | ||
detail: 'You do not have access to online scheduling' | ||
code: '403' | ||
status: '403' |
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ | |
let!(:user) { sis_user(icn: '1012846043V576341') } | ||
|
||
before do | ||
allow_any_instance_of(User).to receive(:va_patient?).and_return(true) | ||
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. just adding the facilities was not working in this spec as it was transforming facilities into test facilities 984. This change is unique to testing env so not worried about effecting prod performance. |
||
allow_any_instance_of(VAOS::UserService).to receive(:session).and_return('stubbed_token') | ||
allow_any_instance_of(VAOS::V2::MobileFacilityService).to \ | ||
receive(:get_clinic).and_return(mock_clinic) | ||
|
@@ -196,7 +197,6 @@ | |
VCR.use_cassette('mobile/appointments/post_appointments_va_proposed_clinic_200', | ||
match_requests_on: %i[method uri]) do | ||
post '/mobile/v0/appointment', params: {}, headers: sis_headers | ||
|
||
expect(response).to have_http_status(:created) | ||
expect(json_body_for(response)).to match_camelized_schema('vaos/v2/appointment', { strict: false }) | ||
end | ||
|
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. This is a separate check so we can return a unique error that FE can eventually use to trigger a banner saying that they don't have any facilities. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,8 @@ | |
def access? | ||
Flipper.enabled?('va_online_scheduling', user) && user.loa3? | ||
end | ||
|
||
def facilities? | ||
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. Would 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. yeah thats better. Updated. |
||
user.va_patient? | ||
end | ||
end |
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.
@kpethtel , I'm unsure if this warrants a flipper. It seems simple enough but let me know if you feel differently.