Sha256: 8f1bdbace2815ccbead8c6b2bdcdc66d831dc346378af7247d546af41f9dfc06
Contents?: true
Size: 1.47 KB
Versions: 1
Compression:
Stored size: 1.47 KB
Contents
describe 'collections/show.html.erb' do let(:document) { SolrDocument.new(id: 'xyz123z4', 'title_tesim' => ['Make Collections Great Again']) } let(:ability) { double } let(:presenter) { Sufia::CollectionPresenter.new(document, ability) } let(:blacklight_config) { CatalogController.blacklight_config } let(:blacklight_configuration_context) do Blacklight::Configuration::Context.new(controller) end before do allow(view).to receive(:blacklight_config).and_return(blacklight_config) allow(view).to receive(:blacklight_configuration_context).and_return(blacklight_configuration_context) allow(document).to receive(:hydra_model).and_return(::Collection) allow(controller).to receive(:current_user).and_return(stub_model(User)) allow(view).to receive(:can?).with(:edit, document).and_return(true) allow(view).to receive(:can?).with(:destroy, document).and_return(true) assign(:presenter, presenter) stub_template '_search_form.html.erb' => 'search form' stub_template 'collections/_sort_and_per_page.html.erb' => 'sort and per page' stub_template 'collections/_document_list.html.erb' => 'document list' stub_template 'collections/_paginate.html.erb' => 'paginate' render end it 'draws the page' do expect(rendered).to have_selector 'h2', text: 'Actions' expect(rendered).to have_link 'Edit' expect(rendered).to have_link 'Delete' expect(rendered).to have_link 'Add works' end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
sufia-7.0.0.beta3 | spec/views/collections/show.html.erb_spec.rb |