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-0.14.0.pre3 spec/models/quick_classification_query_spec.rb
curation_concerns-0.14.0.pre2 spec/models/quick_classification_query_spec.rb
curation_concerns-0.14.0.pre1 spec/models/quick_classification_query_spec.rb
curation_concerns-0.13.1 spec/models/quick_classification_query_spec.rb
curation_concerns-0.13.0 spec/models/quick_classification_query_spec.rb
curation_concerns-0.12.0 spec/models/quick_classification_query_spec.rb
curation_concerns-0.12.0.pre9 spec/models/quick_classification_query_spec.rb
curation_concerns-0.12.0.pre8 spec/models/quick_classification_query_spec.rb
curation_concerns-0.12.0.pre7 spec/models/quick_classification_query_spec.rb
curation_concerns-0.12.0.pre6 spec/models/quick_classification_query_spec.rb
curation_concerns-0.12.0.pre5 spec/models/quick_classification_query_spec.rb
curation_concerns-0.12.0.pre4 spec/models/quick_classification_query_spec.rb
curation_concerns-0.12.0.pre3 spec/models/quick_classification_query_spec.rb
curation_concerns-0.12.0.pre2 spec/models/quick_classification_query_spec.rb
curation_concerns-0.12.0.pre1 spec/models/quick_classification_query_spec.rb
curation_concerns-0.11.0 spec/models/quick_classification_query_spec.rb
curation_concerns-0.11.0.rc1 spec/models/quick_classification_query_spec.rb
curation_concerns-0.10.0 spec/models/quick_classification_query_spec.rb
curation_concerns-0.9.0 spec/models/quick_classification_query_spec.rb
curation_concerns-0.8.0 spec/models/quick_classification_query_spec.rb