X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/4743b2e8f9587146f24359f98b648e92d5b04e38..e6cb66913899a35cda5a5a8df26869cb29c0ebcd:/services/api/test/test_helper.rb diff --git a/services/api/test/test_helper.rb b/services/api/test/test_helper.rb index 7579abf1ff..ef08c726ae 100644 --- a/services/api/test/test_helper.rb +++ b/services/api/test/test_helper.rb @@ -26,7 +26,7 @@ require 'mocha/mini_test' module ArvadosTestSupport def json_response - Oj.load response.body + Oj.strict_load response.body end def api_token(api_client_auth_name) @@ -36,6 +36,10 @@ module ArvadosTestSupport def auth(api_client_auth_name) {'HTTP_AUTHORIZATION' => "OAuth2 #{api_token(api_client_auth_name)}"} end + + def show_errors model + return lambda { model.errors.full_messages.inspect } + end end class ActiveSupport::TestCase @@ -44,6 +48,10 @@ class ActiveSupport::TestCase include ArvadosTestSupport + setup do + Rails.logger.warn "\n\n#{'=' * 70}\n#{self.class}\##{method_name}\n#{'-' * 70}\n\n" + end + teardown do Thread.current[:api_client_ip_address] = nil Thread.current[:api_client_authorization] = nil @@ -102,6 +110,10 @@ class ActiveSupport::TestCase ArvadosApiToken.new.call("rack.input" => "", "HTTP_AUTHORIZATION" => "OAuth2 #{t}") end + + def slow_test + skip "RAILS_TEST_SHORT is set" unless (ENV['RAILS_TEST_SHORT'] || '').empty? + end end class ActionController::TestCase