From 42edb1f09a92905e5e8fc3f58f77df18df3e8668 Mon Sep 17 00:00:00 2001 From: Rick Carlino Date: Thu, 15 Sep 2016 16:57:22 -0500 Subject: [PATCH] Add tests for recent serializer changes. --- .../api/devices/devices_controller_show_spec.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/spec/controllers/api/devices/devices_controller_show_spec.rb b/spec/controllers/api/devices/devices_controller_show_spec.rb index f248fbdfc..5de33e514 100644 --- a/spec/controllers/api/devices/devices_controller_show_spec.rb +++ b/spec/controllers/api/devices/devices_controller_show_spec.rb @@ -13,5 +13,17 @@ describe Api::DevicesController do get :show, {}, format: :json expect(user.reload.device).to be_kind_of(Device) end + + it 'has expected keys' do + sign_in user + get :show, {}, format: :json + { id: Fixnum, + name: String, + uuid: String, + webcam_url: String }.each{ |name, klass| + expect(json[name]).to be_an_instance_of(klass) + } + + end end end