Sha256: e25e0990bae69e0d77311c2ffa20a1fdca32ca1213a9f4d1a9924278081f5410
Contents?: true
Size: 692 Bytes
Versions: 10
Compression:
Stored size: 692 Bytes
Contents
require "test_helper" class HashTest < ActiveSupport::TestCase should "verify Hash#compact" do hash = { "a" => "", "b" => nil, "c" => "hello" } hash_compacted = { "c" => "hello" } assert_equal hash_compacted, hash.compact end context "cleanup" do should "work" 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 should "reject unwanted stuff" do hash = {"attribute" => "dragonfly"} expected = {} assert_equal expected, hash.cleanup end end end
Version data entries
10 entries across 10 versions & 1 rubygems