test.rb: catch unexpected response codes