Sha256: 755e955114dfaf3349f7bc37cb487d66ec48e1bab1ea2da7ece79b8c729ce739

Contents?: true

Size: 1.1 KB

Versions: 8

Compression:

Stored size: 1.1 KB

Contents

describe 'collections/_show_document_list.html.erb', type: :view do
  let(:user) { create(:user) }
  let(:collection) { mock_model(Collection) }

  let(:file) do
    FileSet.create(creator: ["ggm"], title: ['One Hundred Years of Solitude']) do |fs|
      fs.apply_depositor_metadata(user)
    end
  end

  let(:documents) { [file] }

  let(:blacklight_configuration_context) do
    Blacklight::Configuration::Context.new(controller)
  end

  context 'when not logged in' do
    before do
      allow(view).to receive(:blacklight_config).and_return(Blacklight::Configuration.new)
      allow(view).to receive(:blacklight_configuration_context).and_return(blacklight_configuration_context)
      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 "renders 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-7.1.0 spec/views/collections/_show_document_list.html.erb_spec.rb
sufia-7.0.0 spec/views/collections/_show_document_list.html.erb_spec.rb
sufia-7.0.0.rc2 spec/views/collections/_show_document_list.html.erb_spec.rb
sufia-7.0.0.rc1 spec/views/collections/_show_document_list.html.erb_spec.rb
sufia-7.0.0.beta4 spec/views/collections/_show_document_list.html.erb_spec.rb
sufia-7.0.0.beta3 spec/views/collections/_show_document_list.html.erb_spec.rb
sufia-7.0.0.beta2 spec/views/collections/_show_document_list.html.erb_spec.rb
sufia-7.0.0.beta1 spec/views/collections/_show_document_list.html.erb_spec.rb