]> git.openstreetmap.org Git - rails.git/blobdiff - test/test_helper.rb
Update leaflet.osm plugin
[rails.git] / test / test_helper.rb
index 378d49bb9a02f43097cfe13c9b73c32c702e1aac..c19b809ecbcd102e4f606afa29a395ecfd2d681a 100644 (file)
@@ -28,6 +28,9 @@ module ActiveSupport
     include FactoryBot::Syntax::Methods
     include ActiveJob::TestHelper
 
+    # Run tests in parallel with specified workers
+    parallelize(:workers => :number_of_processors)
+
     ##
     # takes a block which is executed in the context of a different
     # ActionController instance. this is used so that code can call methods
@@ -115,6 +118,12 @@ module ActiveSupport
       @request.env["HTTP_AUTHORIZATION"] = format("Basic %{auth}", :auth => Base64.encode64("#{user}:#{pass}"))
     end
 
+    ##
+    # set request header for HTTP Accept
+    def http_accept_format(format)
+      @request.env["HTTP_ACCEPT"] = format
+    end
+
     ##
     # set request readers to ask for a particular error format
     def error_format(format)