[ARVADOS] updated: 701074a294c18ad56b7f17cfc488a2cbc25816d5

git at public.curoverse.com git at public.curoverse.com
Fri Feb 14 14:26:56 EST 2014


Summary of changes:
 .../arvados/v1/collections_controller.rb           |    4 ++++
 services/api/app/models/collection.rb              |    4 ++++
 .../arvados/v1/collections_controller_test.rb      |   18 ++++++++++++++----
 3 files changed, 22 insertions(+), 4 deletions(-)

       via  701074a294c18ad56b7f17cfc488a2cbc25816d5 (commit)
      from  b436539142666c2553a74363fbf7e34fefc9912b (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 701074a294c18ad56b7f17cfc488a2cbc25816d5
Author: Tom Clegg <tom at curoverse.com>
Date:   Fri Feb 14 11:26:44 2014 -0800

    Provide manifest_text in collections.get API response. refs #2070

diff --git a/services/api/app/controllers/arvados/v1/collections_controller.rb b/services/api/app/controllers/arvados/v1/collections_controller.rb
index dc95ea0..c0cd419 100644
--- a/services/api/app/controllers/arvados/v1/collections_controller.rb
+++ b/services/api/app/controllers/arvados/v1/collections_controller.rb
@@ -51,6 +51,10 @@ class Arvados::V1::CollectionsController < ApplicationController
     show
   end
 
+  def show
+    render json: @object.as_api_response(:with_data)
+  end
+
   def collection_uuid(uuid)
     m = /([a-f0-9]{32}(\+[0-9]+)?)(\+.*)?/.match(uuid)
     if m
diff --git a/services/api/app/models/collection.rb b/services/api/app/models/collection.rb
index ef8a909..f6c8b26 100644
--- a/services/api/app/models/collection.rb
+++ b/services/api/app/models/collection.rb
@@ -8,6 +8,10 @@ class Collection < ArvadosModel
     t.add :files
   end
 
+  api_accessible :with_data, extend: :user do |t|
+    t.add :manifest_text
+  end
+
   def redundancy_status
     if redundancy_confirmed_as.nil?
       'unconfirmed'
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 bffb47a..0663eb9 100644
--- a/services/api/test/functional/arvados/v1/collections_controller_test.rb
+++ b/services/api/test/functional/arvados/v1/collections_controller_test.rb
@@ -11,14 +11,24 @@ class Arvados::V1::CollectionsControllerTest < ActionController::TestCase
 
   test "should create" do
     authorize_with :active
+    test_collection = {
+      manifest_text: ". d41d8cd98f00b204e9800998ecf8427e 0:0:foo.txt\n",
+      uuid: "d30fe8ae534397864cb96c544f4cf102"
+    }
     post :create, {
-      collection: {
-        manifest_text: ". d41d8cd98f00b204e9800998ecf8427e 0:0:foo.txt\n",
-        uuid: "d30fe8ae534397864cb96c544f4cf102"
-      }
+      collection: test_collection
     }
     assert_response :success
     assert_nil assigns(:objects)
+
+    get :show, {
+      id: "d30fe8ae534397864cb96c544f4cf102"
+    }
+    assert_response :success
+    assert_not_nil assigns(:object)
+    resp = JSON.parse(@response.body)
+    assert_equal 'd30fe8ae534397864cb96c544f4cf102+47', resp['uuid']
+    assert_equal test_collection[:manifest_text], resp['manifest_text']
   end
 
   test "create with owner_uuid set to owned group" do

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list