Sha256: 762da5d83c7a307532c4edd2ead168f1662357c56111220fea45503df0bd3b3c

Contents?: true

Size: 642 Bytes

Versions: 6

Compression:

Stored size: 642 Bytes

Contents

require 'spec_helper'

describe GenericWork do
  it "should have a title" do
    subject.title = ['foo']
    expect(subject.title).to eq ['foo']
  end

  context "with attached files" do
    subject { FactoryGirl.build(:work_with_files) }

    it "should have two files" do
      expect(subject.generic_files.size).to eq 2
      expect(subject.generic_files.first).to be_kind_of Worthwhile::GenericFile
    end
  end

  describe "to_solr" do
    subject { FactoryGirl.build(:work, date_uploaded: Date.today).to_solr }
    it "indexes some fields" do
      expect(subject.keys).to include 'desc_metadata__date_uploaded_dtsi'
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
worthwhile-0.1.2 spec/models/generic_work_spec.rb
worthwhile-0.1.1 spec/models/generic_work_spec.rb
worthwhile-0.1.0 spec/models/generic_work_spec.rb
worthwhile-0.0.3 spec/models/generic_work_spec.rb
worthwhile-0.0.2 spec/models/generic_work_spec.rb
worthwhile-0.0.1 spec/models/generic_work_spec.rb