Sha256: b3a90f535e78549149804950aae6793ddadb2ddfdfc09f97b38d09f2258d7bd6
Contents?: true
Size: 944 Bytes
Versions: 3
Compression:
Stored size: 944 Bytes
Contents
require 'rails_helper' describe LHS::Data do before(:each) do class Record < LHS::Record endpoint ':datastore/v2/:campaign_id/feedbacks' endpoint ':datastore/v2/feedbacks' end end let(:json) do load_json(:feedbacks) end let(:data) do described_class.new(json, nil, Record) end let(:item) do data[0] end context 'item' do it 'makes data accessible' do expect(item.href).to be_kind_of String expect(item.recommended).to be_kind_of TrueClass expect(item.average_rating).to be_kind_of Float end it 'returns nil if no data is present' do expect(item.something).to eq nil end it 'returns TimeWithZone if string can be parsed as date_time' do expect(item.created_date).to be_kind_of ActiveSupport::TimeWithZone end it 'returns date if string can be parsed as date' do expect(item.valid_from).to be_kind_of Date end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
lhs-3.0.3 | spec/data/item_spec.rb |
lhs-3.0.2 | spec/data/item_spec.rb |
lhs-3.0.1 | spec/data/item_spec.rb |