Sha256: 9f0ae59270b0ef5b1dd02af06e93071d1b5ce257c4dbbd07975406e016ad044f
Contents?: true
Size: 1 KB
Versions: 76
Compression:
Stored size: 1 KB
Contents
# frozen_string_literal: true require 'rails_helper' describe LHS::Record do before do class Business < LHS::Record configuration item_created_key: [:response, :business], limit_key: [:response, :max], pagination_key: [:response, :offset], total_key: [:response, :count], pagination_strategy: :offset endpoint 'http://uberall/businesses' end end let(:stub_create_business_request) do stub_request(:post, "http://uberall/businesses") .to_return(body: { status: "SUCCESS", response: { business: { identifier: 'ABC123', name: 'localsearch', id: 239650 } } }.to_json) end it 'uses paths from configuration to access nested values' do stub_create_business_request business = Business.create!( identifier: 'ABC123', name: 'localsearch' ) expect(business.identifier).to eq 'ABC123' expect(business.name).to eq 'localsearch' expect(business.id).to eq 239650 end end
Version data entries
76 entries across 76 versions & 1 rubygems