Sha256: 61ed162c4ba0dd78973f1043a0b3903bb50b78b679a23024fa41aa7b567ceccb

Contents?: true

Size: 987 Bytes

Versions: 9

Compression:

Stored size: 987 Bytes

Contents

describe 'hyrax/admin/admin_sets/_show_document_list.html.erb', type: :view do
  let(:user) { create(:user, groups: 'admin') }

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

  let(:documents) { [work] }

  before do
    view.blacklight_config = Blacklight::Configuration.new
    allow(view).to receive(:current_user).and_return(user)
    allow(work).to receive(:title_or_label).and_return("One Hundred Years of Solitude")
    allow(work).to receive(:edit_groups).and_return([user])
    allow(work).to receive(:edit_people).and_return([user])
    allow(work).to receive(:workflow_state).and_return('deposited')
    stub_template '_show_document_list_menu.erb' => ''
  end

  it "renders rows of works" do
    render('hyrax/admin/admin_sets/show_document_list.html.erb', documents: documents)
    expect(rendered).to have_content 'One Hundred Years of Solitude'
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
hyrax-1.1.1 spec/views/hyrax/admin/admin_sets/_show_document_list.html.erb_spec.rb
hyrax-1.1.0 spec/views/hyrax/admin/admin_sets/_show_document_list.html.erb_spec.rb
hyrax-1.0.5 spec/views/hyrax/admin/admin_sets/_show_document_list.html.erb_spec.rb
hyrax-1.0.4 spec/views/hyrax/admin/admin_sets/_show_document_list.html.erb_spec.rb
hyrax-1.0.3 spec/views/hyrax/admin/admin_sets/_show_document_list.html.erb_spec.rb
hyrax-1.0.2 spec/views/hyrax/admin/admin_sets/_show_document_list.html.erb_spec.rb
hyrax-1.0.1 spec/views/hyrax/admin/admin_sets/_show_document_list.html.erb_spec.rb
hyrax-1.0.0.rc2 spec/views/hyrax/admin/admin_sets/_show_document_list.html.erb_spec.rb
hyrax-1.0.0.rc1 spec/views/hyrax/admin/admin_sets/_show_document_list.html.erb_spec.rb