api: More robust tests for log properties.
authorBrett Smith <brett@curoverse.com>
Fri, 11 Apr 2014 13:35:49 +0000 (09:35 -0400)
committerBrett Smith <brett@curoverse.com>
Fri, 11 Apr 2014 13:35:49 +0000 (09:35 -0400)
This ensures that logs always have the old/new_etag/attributes
properties, even if they're expressly set to nil.

services/api/test/unit/log_test.rb

index cf744bab7b9aa6136afadd345d15d36c8e0e08b5..6f793afe7ce2757ce22f3b7f69fb190cef2097ed 100644 (file)
@@ -15,8 +15,9 @@ class LogTest < ActiveSupport::TestCase
   end
 
   def assert_properties(test_method, event, props, *keys)
-    verb = (test_method == :assert_nil) ? 'not include' : 'include'
+    verb = (test_method == :assert_nil) ? 'have nil' : 'define'
     keys.each do |prop_name|
+      assert_includes(props, prop_name, "log properties missing #{prop_name}")
       self.send(test_method, props[prop_name],
                 "#{event.to_s} log should #{verb} #{prop_name}")
     end