Sha256: 87fd1d5006181c00d6ecace3a91853b71bc54f6e293f5c68bf952de557d08e3f
Contents?: true
Size: 558 Bytes
Versions: 17
Compression:
Stored size: 558 Bytes
Contents
require 'spec_helper' describe 'LazyAttr' do class TestInovice include ActiveZuora::LazyAttr lazy_load :test_body end subject { TestInovice.new } it "should fetch a lazy loaded attribute from the api" do expect(subject).to receive(:fetch_field).with(:test_body){ 'Jesse "The Body"' } subject.test_body end it "should should not refetch an attribute after it's been loaded once" do expect(subject).to receive(:fetch_field).with(:test_body).once { 'Jesse "The Body"' } subject.test_body subject.test_body end end
Version data entries
17 entries across 17 versions & 1 rubygems