Sha256: 91e4b03794b3a785a43caa377d7e1c92a07a01823e6b5801840d7e7c4ba577db
Contents?: true
Size: 869 Bytes
Versions: 14
Compression:
Stored size: 869 Bytes
Contents
# # item_spec.rb # Crowdskout # # Copyright (c) 2016 Kyle Schutt. All rights reserved.require 'spec_helper' require 'spec_helper' describe Crowdskout::Components::Item do before do @json_string = %[{ "id" : 1, "Gender" : { "id" : 1, "value" : "Male" }, "TestValue" : "value" }] @hash = JSON.parse(@json_string) end it "creates a component" do component = Crowdskout::Components::Item.create(@hash) expect(component.id).to eq 1 component.fields[0].should be_kind_of(Crowdskout::Components::Field) end it "generates the correct json object" do component = Crowdskout::Components::Item.create(@hash) expect(JSON.parse(component.to_json)).to eq @hash end end
Version data entries
14 entries across 14 versions & 1 rubygems