Sha256: 6e80f5f5ac34dd1fd5626bc01a88e2901d1bd8810760c3fff5bd8e2dd3e1e96b
Contents?: true
Size: 631 Bytes
Versions: 7
Compression:
Stored size: 631 Bytes
Contents
require "test_helper" class HashTest < ActiveSupport::TestCase test "compact" do hash = { "a" => "", "b" => nil, "c" => "hello" } hash_compacted = { "c" => "hello" } assert_equal hash_compacted, hash.compact end test "cleanup" do whitelist = %w(controller action id input layout resource resource_id resource_action selected back_to ) whitelist.each do |w| expected = { w => w } assert_equal expected, expected.dup.cleanup end end test "cleanup rejects unwanted stuff" do hash = {"attribute" => "dragonfly"} expected = {} assert_equal expected, hash.cleanup end end
Version data entries
7 entries across 7 versions & 1 rubygems