14873: Adds headers to controller tests' requests.
authorLucas Di Pentima <ldipentima@veritasgenetics.com>
Wed, 27 Mar 2019 18:09:52 +0000 (15:09 -0300)
committerLucas Di Pentima <ldipentima@veritasgenetics.com>
Wed, 27 Mar 2019 18:09:52 +0000 (15:09 -0300)
API server logs used to report 'format: html' when running functional tests.
With these additions, it now reports 'json', but this is not enough to fix
the issue about nested arrays being flattened when running tests.

Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima@veritasgenetics.com>

apps/workbench/.gitignore
services/api/test/test_helper.rb

index 25c7c3ef24ea04acc225e1d1295d424d3959a0cc..fa42a32dd921a22ce9406d55e7dc71ff2c551bf1 100644 (file)
@@ -7,6 +7,8 @@
 /tmp
 .byebug_history
 
+package-lock.json
+
 /config/.secret_token
 /config/initializers/secret_token.rb
 
index ffd50d808072887884caabffab08252aa2d71716..710fb2bc41c62493ae02f01332caf6b9fb33c9ad 100644 (file)
@@ -152,6 +152,10 @@ end
 class ActionController::TestCase
   setup do
     @test_counter = 0
+    # Trying this:
+    # https://stackoverflow.com/questions/44119273/rails-5-1-minitest-flattens-array-of-arrays-in-params
+    self.request.headers['Accept'] = 'application/json'
+    self.request.headers['Content-Type'] = 'application/json'
   end
 
   def check_counter action