Sha256: 55e4beeff44bf2efd53554dee12d690318bba5ef1c7ff202b127cc75d9a5d018

Contents?: true

Size: 910 Bytes

Versions: 12

Compression:

Stored size: 910 Bytes

Contents

describe 'sufia/homepage/_sortable_featured.html.erb', type: :view do
  let(:form_builder)  { double }
  let(:work)          { build(:public_generic_work, id: "99") }
  let(:featured_work) { FeaturedWork.create(work_id: "99", presenter: presenter) }
  let(:presenter)     { Sufia::WorkShowPresenter.new(work, nil) }
  let(:page)          { rendered }

  before do
    allow(view).to receive(:f).and_return(form_builder)
    allow(form_builder).to receive(:object).and_return(featured_work)
    allow(form_builder).to receive(:hidden_field)
    allow(work).to receive(:hydra_model).and_return(GenericWork)
    allow(view).to receive(:render_thumbnail_tag).and_return("thumbnail")
    allow(view).to receive(:can?).with(:destroy, FeaturedWork).and_return(false)
    render
  end

  it "enables featured works to be sorted" do
    expect(page).to include('<div class="dd-handle dd3-handle">Drag</div>')
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
sufia-7.4.1 spec/views/sufia/homepage/_sortable_featured.html.erb_spec.rb
sufia-7.4.0 spec/views/sufia/homepage/_sortable_featured.html.erb_spec.rb
sufia-7.3.1 spec/views/sufia/homepage/_sortable_featured.html.erb_spec.rb
sufia-7.3.0 spec/views/sufia/homepage/_sortable_featured.html.erb_spec.rb
sufia-7.3.0.rc3 spec/views/sufia/homepage/_sortable_featured.html.erb_spec.rb
sufia-7.3.0.rc2 spec/views/sufia/homepage/_sortable_featured.html.erb_spec.rb
sufia-7.3.0.rc1 spec/views/sufia/homepage/_sortable_featured.html.erb_spec.rb
sufia-7.2.0 spec/views/sufia/homepage/_sortable_featured.html.erb_spec.rb
sufia-7.1.0 spec/views/sufia/homepage/_sortable_featured.html.erb_spec.rb
sufia-7.0.0 spec/views/sufia/homepage/_sortable_featured.html.erb_spec.rb
sufia-7.0.0.rc2 spec/views/sufia/homepage/_sortable_featured.html.erb_spec.rb
sufia-7.0.0.rc1 spec/views/sufia/homepage/_sortable_featured.html.erb_spec.rb