[ARVADOS] updated: 36975ebf86c37148ef38a5facd10fad2a977efc9

git at public.curoverse.com git at public.curoverse.com
Thu Sep 25 11:31:29 EDT 2014


Summary of changes:
 .../arvados/v1/collections_controller_test.rb      | 15 ++++++-------
 .../functional/arvados/v1/links_controller_test.rb | 26 +++++++++++++---------
 2 files changed, 22 insertions(+), 19 deletions(-)

       via  36975ebf86c37148ef38a5facd10fad2a977efc9 (commit)
      from  15902f15dc95b9ecb0e0193f9bcdc437fb4fe6f9 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 36975ebf86c37148ef38a5facd10fad2a977efc9
Author: radhika <radhika at curoverse.com>
Date:   Thu Sep 25 11:16:07 2014 -0400

    3889: fix tests that were doing multiple actions in one test.

diff --git a/services/api/test/functional/arvados/v1/collections_controller_test.rb b/services/api/test/functional/arvados/v1/collections_controller_test.rb
index f2c15c6..eb91e7d 100644
--- a/services/api/test/functional/arvados/v1/collections_controller_test.rb
+++ b/services/api/test/functional/arvados/v1/collections_controller_test.rb
@@ -104,17 +104,16 @@ EOS
     assert_response :success
     assert_nil assigns(:objects)
 
-    get :show, {
-      id: test_collection[:portable_data_hash]
-    }
-    assert_response :success
-    assert_not_nil assigns(:object)
-    resp = JSON.parse(@response.body)
-    assert_equal test_collection[:portable_data_hash], resp['portable_data_hash']
+    created = JSON.parse(@response.body)
+
+    retrieved_collection = Collection.select([:uuid, :portable_data_hash, :manifest_text]).
+      where(portable_data_hash: created['portable_data_hash']).first
+
+    assert_equal test_collection[:portable_data_hash], retrieved_collection['portable_data_hash']
 
     # The manifest in the response will have had permission hints added.
     # Remove any permission hints in the response before comparing it to the source.
-    stripped_manifest = resp['manifest_text'].gsub(/\+A[A-Za-z0-9 at _-]+/, '')
+    stripped_manifest = retrieved_collection['manifest_text'].gsub(/\+A[A-Za-z0-9 at _-]+/, '')
     assert_equal test_collection[:manifest_text], stripped_manifest
   end
 
diff --git a/services/api/test/functional/arvados/v1/links_controller_test.rb b/services/api/test/functional/arvados/v1/links_controller_test.rb
index b4b7816..4058101 100644
--- a/services/api/test/functional/arvados/v1/links_controller_test.rb
+++ b/services/api/test/functional/arvados/v1/links_controller_test.rb
@@ -2,17 +2,21 @@ require 'test_helper'
 
 class Arvados::V1::LinksControllerTest < ActionController::TestCase
 
-  test "no symbol keys in serialized hash" do
-    link = {
-      properties: {username: 'testusername'},
-      link_class: 'test',
-      name: 'encoding',
-      tail_uuid: users(:admin).uuid,
-      head_uuid: virtual_machines(:testvm).uuid
-    }
-    authorize_with :admin
-    [link, link.to_json].each do |formatted_link|
-      post :create, link: formatted_link
+  ['link', 'link_json'].each do |formatted_link|
+    test "no symbol keys in serialized hash #{formatted_link}" do
+      link = {
+        properties: {username: 'testusername'},
+        link_class: 'test',
+        name: 'encoding',
+        tail_uuid: users(:admin).uuid,
+        head_uuid: virtual_machines(:testvm).uuid
+      }
+      authorize_with :admin
+      if formatted_link == 'link_json'
+        post :create, link: link.to_json
+      else
+        post :create, link: link
+      end
       assert_response :success
       assert_not_nil assigns(:object)
       assert_equal 'testusername', assigns(:object).properties['username']

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list