[ARVADOS] updated: 83304d43227dce877cc86d87f8f25463a4fac096

git at public.curoverse.com git at public.curoverse.com
Wed May 28 12:43:34 EDT 2014


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

       via  83304d43227dce877cc86d87f8f25463a4fac096 (commit)
      from  6c92a0d8acd0a5525bbe566a3e202b93d498b370 (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 83304d43227dce877cc86d87f8f25463a4fac096
Author: Tom Clegg <tom at curoverse.com>
Date:   Wed May 28 12:43:20 2014 -0400

    2893: Add more tests for bogus serialized hash values.

diff --git a/services/api/test/unit/arvados_model_test.rb b/services/api/test/unit/arvados_model_test.rb
index a0c1327..f7db88c 100644
--- a/services/api/test/unit/arvados_model_test.rb
+++ b/services/api/test/unit/arvados_model_test.rb
@@ -51,11 +51,21 @@ class ArvadosModelTest < ActiveSupport::TestCase
   end
 
   test "Stringify symbols coming from serialized attribute in database" do
+    set_user_from_auth :admin_trustedclient
     fixed = Link.find_by_uuid(links(:has_symbol_keys_in_database_somehow).uuid)
     assert_equal(["baz", "foo"], fixed.properties.keys.sort,
                  "Hash symbol keys from DB did not get stringified.")
     assert_equal(['waz', 'waz', 'waz', 1, nil, false, true],
                  fixed.properties['baz'],
                  "Array symbol values from DB did not get stringified.")
+    assert_equal true, fixed.save, "Failed to save fixed model back to db."
+  end
+
+  test "No HashWithIndifferentAccess in database" do
+    set_user_from_auth :admin_trustedclient
+    assert_raises ActiveRecord::RecordInvalid do
+      Link.create!(link_class: 'test',
+                   properties: {'foo' => 'bar'}.with_indifferent_access)
+    end
   end
 end

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list