X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/a11c56ef66604a9117e3db8c2fa2273c98f88b51..0cefa4c0f3c1b16884b04d6273bd8730166d69ba:/services/api/test/unit/collection_test.rb diff --git a/services/api/test/unit/collection_test.rb b/services/api/test/unit/collection_test.rb index 89c9de3a54..08f46fddcc 100644 --- a/services/api/test/unit/collection_test.rb +++ b/services/api/test/unit/collection_test.rb @@ -118,4 +118,23 @@ class CollectionTest < ActiveSupport::TestCase end end end + + [0, 2, 4, nil].each do |ask| + test "replication_desired reports #{ask or 2} if redundancy is #{ask}" do + act_as_user users(:active) do + c = collections(:collection_owned_by_active) + c.update_attributes redundancy: ask + assert_equal (ask or 2), c.replication_desired + end + end + end + + test "create collection with properties" do + act_as_system_user do + c = Collection.create(manifest_text: ". acbd18db4cc2f85cedef654fccc4a4d8+3 0:3:foo\n", + properties: {'property_1' => 'value_1'}) + assert c.valid? + assert_equal 'value_1', c.properties['property_1'] + end + end end