Raise ArgumentError when required openid_prefix is not passed.
[arvados.git] / services / api / test / functional / arvados / v1 / links_controller_test.rb
index b3bc58667943efdb5323fb9c63a8eb8dc37c3a6e..afecc18bb01d778f536cc9dbdf6ee5bb6799d3f9 100644 (file)
@@ -1,4 +1,25 @@
 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_kind: 'arvados#user',
+      tail_uuid: users(:admin).uuid,
+      head_kind: 'arvados#virtualMachine',
+      head_uuid: virtual_machines(:testvm).uuid
+    }
+    authorize_with :admin
+    [link, link.to_json].each do |formatted_link|
+      post :create, link: formatted_link
+      assert_response :success
+      assert_not_nil assigns(:object)
+      assert_equal 'testusername', assigns(:object).properties['username']
+      assert_equal false, assigns(:object).properties.has_key?(:username)
+    end
+  end
+  
 end