Sha256: 0c4609c4cb4f0b8b207b7f577e8476a21512753db26f5883d3ea302015563527

Contents?: true

Size: 991 Bytes

Versions: 6

Compression:

Stored size: 991 Bytes

Contents

require 'spec_helper'

describe 'collections/_show_descriptions.html.erb', :type => :view do
  context 'displaying a custom collection' do
    before do
      @collection = mock_model(Collection)
      allow(view).to receive(:blacklight_config).and_return(Blacklight::Configuration.new)
      allow(@collection).to receive(:date_modified).and_return(["today"])
      allow(@collection).to receive(:terms_for_display).and_return([:date_modified])
      allow(@collection).to receive(:members).and_return(["foo","bar"])
      allow(@collection).to receive(:bytes).and_return(123456678)
    end

    it "should draw the metadata fields for collection" do
      render
      expect(rendered).to have_content 'Date modified'
      expect(rendered).to include('itemprop="date_modified"')
      expect(rendered).to have_content 'Total Items'
      expect(rendered).to have_content '2'
      expect(rendered).to have_content 'Size'
      expect(rendered).to have_content '118 MB'
    end
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
sufia-5.0.0 spec/views/collections/_show_descriptions.html.erb_spec.rb
sufia-5.0.0.rc1 spec/views/collections/_show_descriptions.html.erb_spec.rb
sufia-4.3.1 spec/views/collections/_show_descriptions.html.erb_spec.rb
sufia-6.0.0.beta1 spec/views/collections/_show_descriptions.html.erb_spec.rb
sufia-4.2.0 spec/views/collections/_show_descriptions.html.erb_spec.rb
sufia-4.1.0 spec/views/collections/_show_descriptions.html.erb_spec.rb