Sha256: 55b3b6ab72d83e48603a4a9a0075bf34b08fe07a2d21977dd1ef8a3f70e005a9

Contents?: true

Size: 721 Bytes

Versions: 6

Compression:

Stored size: 721 Bytes

Contents

require 'spec_helper'
require 'active_record'

module Draper
  module QueryMethods
    describe LoadStrategy do
      describe '#new' do
        subject { described_class.new(:active_record) }

        it { is_expected.to be_an_instance_of(LoadStrategy::ActiveRecord) }
      end
    end

    describe LoadStrategy::ActiveRecord do
      describe '#allowed?' do
        it 'checks whether or not ActiveRecord::Relation::VALUE_METHODS has the given method' do
          allow(::ActiveRecord::Relation::VALUE_METHODS).to receive(:include?)

          described_class.new.allowed? :foo

          expect(::ActiveRecord::Relation::VALUE_METHODS).to have_received(:include?).with(:foo)
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
draper-4.0.4 spec/draper/query_methods/load_strategy_spec.rb
draper-4.0.3 spec/draper/query_methods/load_strategy_spec.rb
draper-4.0.2 spec/draper/query_methods/load_strategy_spec.rb
draper-4.0.1 spec/draper/query_methods/load_strategy_spec.rb
draper-4.0.0 spec/draper/query_methods/load_strategy_spec.rb
draper-3.1.0 spec/draper/query_methods/load_strategy_spec.rb