Sha256: 55f7a851626365d1b760bcf7fe93a212c2f4a97da8a4e0b816a26bcbffeec418

Contents?: true

Size: 943 Bytes

Versions: 64

Compression:

Stored size: 943 Bytes

Contents

require 'spec_helper'

describe CurationConcerns::QuickClassificationQuery do
  let(:user) { create(:user) }

  context "with no options" do
    let(:query) { described_class.new(user) }
    describe "#all?" do
      subject { query.all? }
      it { is_expected.to be true }
    end

    describe '#each' do
      let(:thing) { double }
      before do
        # Ensure that no other test has altered the configuration:
        allow(CurationConcerns.config).to receive(:registered_curation_concern_types).and_return(['GenericWork'])
      end
      it "calls the block once for every model" do
        expect(thing).to receive(:test).with(GenericWork)
        query.each do |f|
          thing.test(f)
        end
      end
    end
  end

  context "with models" do
    let(:query) { described_class.new(user, models: ['dataset']) }
    describe "#all?" do
      subject { query.all? }
      it { is_expected.to be false }
    end
  end
end

Version data entries

64 entries across 64 versions & 1 rubygems

Version Path
curation_concerns-1.7.8 spec/models/quick_classification_query_spec.rb
curation_concerns-1.7.7 spec/models/quick_classification_query_spec.rb
curation_concerns-2.0.0 spec/models/quick_classification_query_spec.rb
curation_concerns-2.0.0.rc2 spec/models/quick_classification_query_spec.rb
curation_concerns-1.7.6 spec/models/quick_classification_query_spec.rb
curation_concerns-1.7.5 spec/models/quick_classification_query_spec.rb
curation_concerns-1.7.4 spec/models/quick_classification_query_spec.rb
curation_concerns-1.7.3 spec/models/quick_classification_query_spec.rb
curation_concerns-1.7.2 spec/models/quick_classification_query_spec.rb
curation_concerns-2.0.0.rc1 spec/models/quick_classification_query_spec.rb
curation_concerns-1.7.1 spec/models/quick_classification_query_spec.rb
curation_concerns-1.7.0 spec/models/quick_classification_query_spec.rb
curation_concerns-1.7.0.beta1 spec/models/quick_classification_query_spec.rb
curation_concerns-1.6.3 spec/models/quick_classification_query_spec.rb
curation_concerns-1.6.2 spec/models/quick_classification_query_spec.rb
curation_concerns-1.6.1 spec/models/quick_classification_query_spec.rb
curation_concerns-1.6.0 spec/models/quick_classification_query_spec.rb
curation_concerns-1.5.0 spec/models/quick_classification_query_spec.rb
curation_concerns-1.4.0 spec/models/quick_classification_query_spec.rb
curation_concerns-1.3.3 spec/models/quick_classification_query_spec.rb