X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/31778fd1554d0c23298c92fb62c2277200e31e61..0449024ca0f53307615993e9a480a28355153bc7:/test/test_helper.rb diff --git a/test/test_helper.rb b/test/test_helper.rb index 9633989cd..33a1c92da 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -185,5 +185,17 @@ module ActiveSupport stub_request(:get, "http://api.hostip.info/country.php?ip=0.0.0.0") stub_request(:get, "http://api.hostip.info/country.php?ip=127.0.0.1") end + + def email_text_parts(message) + text_parts = [] + message.parts.each do |part| + if part.content_type.start_with?("text/") + text_parts.push(part) + elsif part.multipart? + text_parts.concat(email_text_parts(part)) + end + end + return text_parts + end end end