File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ def find_if_active(id)
4444 end
4545 rescue Error ::AlmaRecordNotFoundError => e
4646 return if e . message . include? ( 'Alma query failed with response: 404' )
47+ return if e . message . include? ( 'Alma query failed with response: 400' )
4748
4849 raise
4950 end
Original file line number Diff line number Diff line change @@ -73,6 +73,18 @@ def show_path(id)
7373 end
7474 end
7575
76+ it 'forbids users when active patron lookup returns Alma 400' do
77+ patron_id = Alma ::Type . sample_id_for ( allowed_patron_types . first )
78+ allow ( AlmaServices ::Patron ) . to receive ( :get_user ) . with ( patron_id )
79+ . and_raise ( Error ::AlmaRecordNotFoundError ,
80+ 'Alma query failed with response: 400' )
81+
82+ with_patron_login ( patron_id ) do
83+ get new_form_path
84+ expect ( response ) . to have_http_status ( :forbidden )
85+ end
86+ end
87+
7688 describe 'with a valid user' do
7789 attr_reader :patron_id
7890 attr_reader :patron
You can’t perform that action at this time.
0 commit comments