Sha256: 40a2643a5fb1092a74b258084eebaef3e091e40cf504512a81bae243e5090949

Contents?: true

Size: 1.23 KB

Versions: 25

Compression:

Stored size: 1.23 KB

Contents

require 'spec_helper'

describe CurationConcerns::WorkBehavior do
  before do
    class EssentialWork < ActiveFedora::Base
      include CurationConcerns::WorkBehavior
    end
  end
  after do
    Object.send(:remove_const, :EssentialWork)
  end

  subject { EssentialWork.new }

  it 'mixs together all the goodness' do
    [::CurationConcerns::WithFileSets, ::CurationConcerns::HumanReadableType, CurationConcerns::Noid, CurationConcerns::Serializers, Hydra::WithDepositor, Hydra::AccessControls::Embargoable, Solrizer::Common].each do |mixin|
      expect(subject.class.ancestors).to include(mixin)
    end
  end
  describe '#to_s' do
    it 'uses the provided titles' do
      subject.title = %w(Hello World)
      expect(subject.to_s).to eq('Hello | World')
    end
  end

  describe 'human_readable_type' do
    it 'has a default' do
      expect(subject.human_readable_type).to eq 'Essential Work'
    end
    it 'is settable' do
      EssentialWork.human_readable_type = 'Custom Type'
      expect(subject.human_readable_type).to eq 'Custom Type'
    end
  end

  it 'inherits (and extends) to_solr behaviors from superclass' do
    expect(subject.to_solr.keys).to include(:id)
    expect(subject.to_solr.keys).to include('has_model_ssim')
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
curation_concerns-0.14.0.pre4 spec/models/curation_concerns/work_behavior_spec.rb
curation_concerns-0.14.0.pre3 spec/models/curation_concerns/work_behavior_spec.rb
curation_concerns-0.14.0.pre2 spec/models/curation_concerns/work_behavior_spec.rb
curation_concerns-0.14.0.pre1 spec/models/curation_concerns/work_behavior_spec.rb
curation_concerns-0.13.1 spec/models/curation_concerns/work_behavior_spec.rb
curation_concerns-0.13.0 spec/models/curation_concerns/work_behavior_spec.rb
curation_concerns-0.12.0 spec/models/curation_concerns/work_behavior_spec.rb
curation_concerns-0.12.0.pre9 spec/models/curation_concerns/work_behavior_spec.rb
curation_concerns-0.12.0.pre8 spec/models/curation_concerns/work_behavior_spec.rb
curation_concerns-0.12.0.pre7 spec/models/curation_concerns/work_behavior_spec.rb
curation_concerns-0.12.0.pre6 spec/models/curation_concerns/work_behavior_spec.rb
curation_concerns-0.12.0.pre5 spec/models/curation_concerns/work_behavior_spec.rb
curation_concerns-0.12.0.pre4 spec/models/curation_concerns/work_behavior_spec.rb
curation_concerns-0.12.0.pre3 spec/models/curation_concerns/work_behavior_spec.rb
curation_concerns-0.12.0.pre2 spec/models/curation_concerns/work_behavior_spec.rb
curation_concerns-0.12.0.pre1 spec/models/curation_concerns/work_behavior_spec.rb
curation_concerns-0.11.0 spec/models/curation_concerns/work_behavior_spec.rb
curation_concerns-0.11.0.rc1 spec/models/curation_concerns/work_behavior_spec.rb
curation_concerns-0.10.0 spec/models/curation_concerns/work_behavior_spec.rb
curation_concerns-0.9.0 spec/models/curation_concerns/work_behavior_spec.rb