spec/json_spec.rb in strong_json-0.1.2 vs spec/json_spec.rb in strong_json-0.2.0
- old
+ new
@@ -2,11 +2,11 @@
describe "StrongJSON.new" do
it "tests the structure of a JSON object" do
s = StrongJSON.new do
let :item, object(name: string, count: numeric, price: numeric, comment: ignored)
- let :checkout, object(items: array(item), change: optional(number))
+ let :checkout, object(items: array(item), change: optional(number), type: enum(literal(1), symbol))
end
- expect(s.checkout.coerce(items: [ { name: "test", count: 1, price: "2.33", comment: "dummy" } ])).to eq(items: [ { name: "test", count: 1, price: "2.33" }])
+ expect(s.checkout.coerce(items: [ { name: "test", count: 1, price: "2.33", comment: "dummy" }], type: 1)).to eq(items: [ { name: "test", count: 1, price: "2.33" }], type: 1)
end
end