Sha256: befa280499d200c11cbd9f6ac07aeb9b3a69d9021a5a4ed777ad0d71b0170286
Contents?: true
Size: 969 Bytes
Versions: 14
Compression:
Stored size: 969 Bytes
Contents
# # field_options_spec.rb # Crowdskout # # Copyright (c) 2016 Kyle Schutt. All rights reserved.require 'spec_helper' require 'spec_helper' describe Crowdskout::Components::FieldOptions do before do @json_string = %[{ "collection" : "PhysicalAddresses", "options" : [ { "id" : 1, "value" : "Lisbon" } ] }] @hash = JSON.parse(@json_string) end it "creates a field option" do field_option = Crowdskout::Components::FieldOptions.create(@hash) expect(field_option.collection).to eq "PhysicalAddresses" expect(field_option.options.count).to eq 1 end it "generates the correct json object" do field_option = Crowdskout::Components::FieldOptions.create(@hash) expect(JSON.parse(field_option.to_json)).to eq @hash end end
Version data entries
14 entries across 14 versions & 1 rubygems