Sha256: d140a267243cf738370a615c68074f44d324924585d6061c57bc7e9ded3db731

Contents?: true

Size: 966 Bytes

Versions: 8

Compression:

Stored size: 966 Bytes

Contents

require 'spec_helper'

describe 'collections/_show_document_list.html.erb', :type => :view do

  let(:user) { FactoryGirl.find_or_create(:jill) }
  let(:collection) { mock_model(Collection) }

  let(:file) do
    gf = GenericFile.new(creator: ["ggm"], title: ['One Hundred Years of Solitude'])
    gf.apply_depositor_metadata(user)
    gf.save
    gf
  end

  let(:documents) {[file]}

  context 'when not logged in' do
    before do
      allow(view).to receive(:blacklight_config).and_return(Blacklight::Configuration.new)
      allow(view).to receive(:current_user).and_return(nil)
      allow(file).to receive(:title_or_label).and_return("One Hundred Years of Solitude")
      allow(file).to receive(:edit_people).and_return([])
    end

    it "should render collection" do
      render(partial: 'collections/show_document_list.html.erb', locals: {documents: documents})
      expect(rendered).to have_content 'One Hundred Years of Solitude'
    end
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
sufia-6.2.0 spec/views/collections/_show_document_list.erb_spec.rb
sufia-6.1.0 spec/views/collections/_show_document_list.erb_spec.rb
sufia-6.0.0 spec/views/collections/_show_document_list.erb_spec.rb
sufia-6.0.0.rc4 spec/views/collections/_show_document_list.erb_spec.rb
sufia-6.0.0.rc3 spec/views/collections/_show_document_list.erb_spec.rb
sufia-6.0.0.rc2 spec/views/collections/_show_document_list.erb_spec.rb
sufia-6.0.0.rc1 spec/views/collections/_show_document_list.erb_spec.rb
sufia-6.0.0.beta1 spec/views/collections/_show_document_list.erb_spec.rb