From the docs on ActiveSupport :: HashWithIndifferentAccess :
This class has dubious semantics, and we only have it so that people can write params [: key] instead of params ['key], and they get the same value for both keys.
So, this is a class that inherits from Hash so you can pass a character or string as a key and return the same value for.
To fix (and clean) your tests, you can simply use the following:
some_object.is_a? Hash
This will return true if it is a hash or a descendant of a hash.
source share