[ARVADOS] updated: fb179796cc5605ae8c825523c015a9b00f467550

git at public.curoverse.com git at public.curoverse.com
Mon Feb 16 14:28:02 EST 2015


Summary of changes:
 services/api/test/unit/collection_test.rb | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

       via  fb179796cc5605ae8c825523c015a9b00f467550 (commit)
      from  fd172dd6875c8bf1481c6e078590c0ccef934bca (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 fb179796cc5605ae8c825523c015a9b00f467550
Author: Radhika Chippada <radhika at curoverse.com>
Date:   Mon Feb 16 14:07:58 2015 -0500

    5197: write a failing test

diff --git a/services/api/test/unit/collection_test.rb b/services/api/test/unit/collection_test.rb
index 08f46fd..f76c278 100644
--- a/services/api/test/unit/collection_test.rb
+++ b/services/api/test/unit/collection_test.rb
@@ -137,4 +137,24 @@ class CollectionTest < ActiveSupport::TestCase
       assert_equal 'value_1', c.properties['property_1']
     end
   end
+
+  test 'create, delete, recreate collection with same name and owner' do
+    act_as_user users(:active) do
+      # create collection with name
+      c = Collection.create(manifest_text: '',
+                            name: "test collection name")
+      assert c.valid?
+      uuid = c.uuid
+
+      # mark collection as expired
+      c.update_attribute 'expires_at', Time.new.strftime("%Y-%m-%d")
+      c = Collection.where(uuid: uuid)
+      assert_empty c, 'Should not be able to find expired collection'
+
+      # recreate collection with the same name
+      c = Collection.create(manifest_text: '',
+                            name: "test collection name")
+      assert c.valid?
+    end
+  end
 end

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list