Skip to content

Commit

Permalink
Falsches Stubing für Geocodr-Anfragen berichtigt (#317)
Browse files Browse the repository at this point in the history
  • Loading branch information
ro3t authored Oct 12, 2023
1 parent bbff0fc commit b0af503
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/controllers/citysdk/requests_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ class RequestsControllerTest < ActionDispatch::IntegrationTest
end

test 'create with frontend api-key but geocodr returns forbidden' do
URI.stub :open, OpenURI::HTTPError.new(403, 'FORBIDDEN') do
OpenURI.stub :open_uri, ->(_a, _b) { raise OpenURI::HTTPError.new(403, 'FORBIDDEN') } do
post "/citysdk/requests.xml?api_key=#{api_key_frontend}", params: valid_create_params
doc = Nokogiri::XML(response.parsed_body)
service_request_id = doc.xpath('/service_requests/request/service_request_id')
Expand All @@ -251,7 +251,7 @@ class RequestsControllerTest < ActionDispatch::IntegrationTest
end

test 'create with frontend api-key but geocodr is not available' do
URI.stub :open, OpenURI::HTTPError.new(500, 'INTERNAL SERVER ERROR') do
OpenURI.stub :open_uri, ->(_a, _b) { raise OpenURI::HTTPError.new(500, 'INTERNAL SERVER ERROR') } do
post "/citysdk/requests.xml?api_key=#{api_key_frontend}", params: valid_create_params
doc = Nokogiri::XML(response.parsed_body)
service_request_id = doc.xpath('/service_requests/request/service_request_id')
Expand Down Expand Up @@ -350,7 +350,7 @@ class RequestsControllerTest < ActionDispatch::IntegrationTest
test 'update attribute address_string but geocodr is not available' do
new_value = 'Holbeinplatz 14, 18069 Rostock'

URI.stub :open, OpenURI::HTTPError.new(500, 'INTERNAL SERVER ERROR') do
OpenURI.stub :open_uri, ->(_a, _b) { raise OpenURI::HTTPError.new(500, 'INTERNAL SERVER ERROR') } do
put "/citysdk/requests/#{issue(:one).id}.xml?api_key=#{api_key_ppc}", params: { address_string: new_value }
doc = Nokogiri::XML(response.parsed_body)
assert_error_messages doc, '422', 'Gültigkeitsprüfung ist fehlgeschlagen'
Expand Down

0 comments on commit b0af503

Please sign in to comment.