[ARVADOS] created: 1.3.0-994-g5ea0a240e

Git user git at public.curoverse.com
Tue Jun 4 17:40:18 UTC 2019


        at  5ea0a240eb08a4d43d5f7670a694f0158f0bac36 (commit)


commit 5ea0a240eb08a4d43d5f7670a694f0158f0bac36
Author: Lucas Di Pentima <ldipentima at veritasgenetics.com>
Date:   Tue Jun 4 14:39:21 2019 -0300

    15306: Adds integration tests with query string & form encoded params.
    
    Specifically testing include_trash on collections.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima at veritasgenetics.com>

diff --git a/services/api/test/integration/collections_api_test.rb b/services/api/test/integration/collections_api_test.rb
index eb44b9b34..78edbffa6 100644
--- a/services/api/test/integration/collections_api_test.rb
+++ b/services/api/test/integration/collections_api_test.rb
@@ -275,6 +275,51 @@ class CollectionsApiTest < ActionDispatch::IntegrationTest
     end
   end
 
+  [
+    ["false", false],
+    ["0", false],
+    ["true", true],
+    ["1", true]
+  ].each do |param, truthiness|
+    test "include_trash=#{param} param encoding via query string should be interpreted as include_trash=#{truthiness}" do
+      expired_col = collections(:expired_collection)
+      assert expired_col.is_trashed
+      params = {
+        :include_trash => param,
+      }
+      get "/arvados/v1/collections?#{params.to_query}",
+        headers: auth(:active)
+      assert_response :success
+      assert_not_nil json_response['items']
+      refute_empty json_response['items']
+      assert_equal truthiness, json_response['items'].collect {|c| c['uuid']}.include?(expired_col.uuid)
+    end
+  end
+
+  [
+    ["false", false],
+    ["0", false],
+    ["true", true],
+    ["1", true]
+  ].each do |param, truthiness|
+    test "include_trash=#{param} form-encoded param should be interpreted as include_trash=#{truthiness}" do
+      expired_col = collections(:expired_collection)
+      assert expired_col.is_trashed
+      params = [
+        ['include_trash', param],
+      ]
+      get "/arvados/v1/collections",
+        params: URI.encode_www_form(params),
+        headers: {
+          "Content-type" => "application/x-www-form-urlencoded"
+        }.update(auth(:active))
+      assert_response :success
+      assert_not_nil json_response['items']
+      refute_empty json_response['items']
+      assert_equal truthiness, json_response['items'].collect {|c| c['uuid']}.include?(expired_col.uuid)
+    end
+  end
+
   test "search collection using full text search" do
     # create collection to be searched for
     signed_manifest = Collection.sign_manifest(". 85877ca2d7e05498dd3d109baf2df106+95+A3a4e26a366ee7e4ed3e476ccf05354761be2e4ae at 545a9920 0:95:file_in_subdir1\n./subdir2/subdir3 2bbc341c702df4d8f42ec31f16c10120+64+A315d7e7bad2ce937e711fc454fae2d1194d14d64 at 545a9920 0:32:file1_in_subdir3.txt 32:32:file2_in_subdir3.txt\n./subdir2/subdir3/subdir4 2bbc341c702df4d8f42ec31f16c10120+64+A315d7e7bad2ce937e711fc454fae2d1194d14d64 at 545a9920 0:32:file3_in_subdir4.txt 32:32:file4_in_subdir4.txt\n", api_token(:active))

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list