Sha256: d5235cc0769cae0703b472a0c7e38a86625359a70700e2ecad20a15e617fbaff
Contents?: true
Size: 708 Bytes
Versions: 18
Compression:
Stored size: 708 Bytes
Contents
require 'rails_helper' describe LHC do context 'data accessor (hash with indifferent access)' do before(:each) do stub_request(:get, "http://local.ch/") .with(headers: { 'Accept' => 'application/json; charset=utf-8', 'Content-Type' => 'application/json; charset=utf-8' }) .to_return(body: { 'MyProp' => 'MyValue' }.to_json) end it 'makes data accessible with square bracket accessor (string)' do expect( LHC.json.get('http://local.ch')['MyProp'] ).to eq 'MyValue' end it 'makes data accessible with square bracket accessor (symbol)' do expect( LHC.json.get('http://local.ch')[:MyProp] ).to eq 'MyValue' end end end
Version data entries
18 entries across 18 versions & 1 rubygems