Sha256: ab0fbe4769b296d68e9001d1449674e0f9bfabef957022bc8320939bfe6976c8
Contents?: true
Size: 859 Bytes
Versions: 6
Compression:
Stored size: 859 Bytes
Contents
require 'test_helper' class ValueMapTest < ActiveSupport::TestCase test "value map can fetch what you supplied it" do expected_map = [[1, "Concordia"], [2, "McKendree"]] assert_equal expected_map, SetBuilder::ValueMap.for(:school) end test "value map should fetch the correct value" do expected_school = "Concordia" assert_equal expected_school, SetBuilder::ValueMap.to_s(:school, 1) end test "value map should fetch the correct value when passed as a string" do expected_school = "Concordia" assert_equal expected_school, SetBuilder::ValueMap.to_s("school", 1) end test "value map should generate json that can be handed to the client-side SetBuilder" do expected_json = "{\"school\":[[1,\"Concordia\"],[2,\"McKendree\"]]}" assert_equal expected_json, SetBuilder::ValueMap.to_json end end
Version data entries
6 entries across 6 versions & 1 rubygems