Sha256: f0066de3e4e3993be6a5badca8ee212332bf9dbd2caf83cc0eb868aee47548d3

Contents?: true

Size: 493 Bytes

Versions: 2

Compression:

Stored size: 493 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

describe Acfs::Resource::Loadable do
  let(:model) { MyUser.find 1 }

  before do
    stub_request(:get, 'http://users.example.org/users/1')
      .to_return response id: 1, name: 'Anon', age: 12
  end

  describe '#loaded?' do
    context 'before Acfs#run' do
      it { expect(model).not_to be_loaded }
    end

    context 'afer Acfs#run' do
      before { model && Acfs.run }

      it { expect(model).to be_loaded }
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
acfs-2.0.0 spec/acfs/resource/loadable_spec.rb
acfs-1.7.0 spec/acfs/resource/loadable_spec.rb