Sha256: f2c13a5606eefd29cf4ac023cba570f1e0e6b8aa802f1cce1bf93defd07590b3

Contents?: true

Size: 884 Bytes

Versions: 5

Compression:

Stored size: 884 Bytes

Contents

require 'spec_helper'

describe QuickClassificationQuery do
  let(:normalizer) { lambda {|name| name.to_s.classify } }
  let(:registered_curation_concern_names) { ['Dataset'] }
  let(:curation_concern_names_to_try) { ['GenericWork', 'Dataset', 'Object'] }

  subject { described_class.new(query_context, options) }
  let(:options) {
    {
      concern_name_normalizer: normalizer,
      registered_curation_concern_names: registered_curation_concern_names,
      curation_concern_names_to_try: curation_concern_names_to_try
    }
  }
  let(:query_context) { User.new.tap { |u| u.stub(groups: ['registered']) } }

  context '#all' do
    its(:all) { should == [Dataset] }
  end

  context '.each_for_context' do
    it 'should yield' do
      expect {|b|
        described_class.each_for_context(query_context, options, &b)
      }.to yield_successive_args(Dataset)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
curate-0.6.6 spec/models/quick_classification_query_spec.rb
curate-0.6.5 spec/models/quick_classification_query_spec.rb
curate-0.6.4 spec/models/quick_classification_query_spec.rb
curate-0.6.3 spec/models/quick_classification_query_spec.rb
curate-0.6.1 spec/models/quick_classification_query_spec.rb