Sto provando a scrivere una specifica rspec per verificare che la mia logica sia in grado di gestire un particolare Net :: HTTPResponse che ha il codice di stato 401. Come io ' m usando HTTParty, .get mi restituirà un HTTPartyResponse e recupererò Net :: HTTPResponse con httparty_repsonse_object.response.Stub una richiesta http per restituire una HTTPartyResponse con una Net :: HTTPResponse
net_response_object = Net::HTTPResponse.new(1.1, 401, 'Forbidden')
#not sure what to do here? write a test double to return a net_response_object?
stub_request(:any, /hello.com/).to_return(a_http_party_response_object)