Skip to content

Commit

Permalink
Removing extensions from template render calls due to changes in rspe…
Browse files Browse the repository at this point in the history
…c-rails
  • Loading branch information
randalldfloyd committed Oct 15, 2024
1 parent 0befe1d commit e6bf157
Show file tree
Hide file tree
Showing 14 changed files with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
end

it "renders rows of works" do
render('hyrax/admin/admin_sets/show_document_list.html.erb', documents: documents)
render('hyrax/admin/admin_sets/show_document_list', documents: documents)
expect(rendered).to have_css('tbody', text: documents.join)
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
end

it "renders works" do
render 'hyrax/admin/admin_sets/show_document_list_row.html.erb', show_document_list_row: work
render 'hyrax/admin/admin_sets/show_document_list_row', show_document_list_row: work
expect(rendered).to have_content 'One Hundred Years of Solitude'
expect(rendered).to have_content 'deposited'
end
Expand Down
2 changes: 1 addition & 1 deletion spec/views/hyrax/base/_member.html.erb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
allow(view).to receive(:contextual_path).with(anything, anything) do |x, y|
Hyrax::ContextualPath.new(x, y).show
end
render 'hyrax/base/member.html.erb', member: presenter
render 'hyrax/base/member', member: presenter
end

it 'checks the :download ability' do
Expand Down
2 changes: 1 addition & 1 deletion spec/views/hyrax/batch_select/_add_button.html.erb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
RSpec.describe 'hyrax/batch_select/_add_button.html.erb', type: :view do
let(:document) { double(id: 123) }
before do
render 'hyrax/batch_select/add_button.html.erb', document: document
render 'hyrax/batch_select/add_button', document: document
end

it 'renders a checkbox named "batch_document_ids[]"' do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
context 'when not logged in' do
it "renders the documents without an Action section" do
allow(view).to receive(:current_user).and_return(nil)
render('hyrax/collections/show_document_list.html.erb', documents: documents)
render('hyrax/collections/show_document_list', documents: documents)
expect(rendered).to have_css('tbody', text: documents.join)
expect(rendered).not_to have_css('th', text: 'Action')
end
Expand All @@ -17,7 +17,7 @@
context 'when logged in' do
it "renders the documents without an Action section" do
allow(view).to receive(:current_user).and_return(true)
render('hyrax/collections/show_document_list.html.erb', documents: documents)
render('hyrax/collections/show_document_list', documents: documents)
expect(rendered).to have_css('tbody', text: documents.join)
expect(rendered).not_to have_css('th', text: 'Action')
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
end

it "renders collections links" do
render('hyrax/collections/show_document_list_row.html.erb', document: solr_doc)
render('hyrax/collections/show_document_list_row', document: solr_doc)
expect(rendered).not_to have_content 'My awesome collection'
end

it "renders works" do
render('hyrax/collections/show_document_list_row.html.erb', document: solr_doc)
render('hyrax/collections/show_document_list_row', document: solr_doc)
expect(rendered).to have_content 'One Hundred Years of Solitude'
expect(rendered).not_to have_content('Edit Access:')
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
'date_created_tesim' => '2000-01-01'
}
end
let(:subject) { render('show_parent_collections.html.erb', presenter: presenter) }
let(:subject) { render('show_parent_collections', presenter: presenter) }
let(:ability) { double }
let(:solr_document) { SolrDocument.new(collection_doc) }
let(:presenter) { Hyrax::CollectionPresenter.new(solr_document, ability) }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true
RSpec.describe 'hyrax/collections/_subcollection_list.html.erb', type: :view do
let(:subject) { render('subcollection_list.html.erb', collection: subcollection) }
let(:subject) { render('subcollection_list', collection: subcollection) }
let(:collection) { stub_model(Collection, id: '123') }

context 'when subcollection list is empty' do
Expand All @@ -11,7 +11,7 @@
end

it "posts a warning message" do
render('subcollection_list.html.erb', collection: subcollection)
render('subcollection_list', collection: subcollection)
expect(rendered).to have_text("There are no visible subcollections.")
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
before do
allow(ability).to receive(:admin?).and_return(false)
allow(presenter).to receive(:managed_access).and_return('Manage Access')
render('list_collections.html.erb', collection_presenter: presenter)
render('list_collections', collection_presenter: presenter)
end

# NOTE: Real labels are Manage, Deposit, or View, but UI shows whatever label gets returned,
Expand All @@ -47,7 +47,7 @@
before do
allow(ability).to receive(:admin?).and_return(true)
allow(presenter).to receive(:managed_access).and_return('Manage')
render('list_collections.html.erb', collection_presenter: presenter)
render('list_collections', collection_presenter: presenter)
end

it "doesn't show access" do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
context 'when not logged in' do
it "renders the documents without an Action section" do
allow(view).to receive(:current_user).and_return(nil)
render('show_document_list.html.erb', documents: documents)
render('show_document_list', documents: documents)
expect(rendered).to have_css('tbody', text: documents.join)
expect(rendered).not_to have_css('th', text: 'Action')
end
Expand All @@ -17,7 +17,7 @@
context 'when logged in' do
it "renders the documents with an Action section" do
allow(view).to receive(:current_user).and_return(true)
render('show_document_list.html.erb', documents: documents)
render('show_document_list', documents: documents)
expect(rendered).to have_css('tbody', text: documents.join)
expect(rendered).to have_css('th', text: 'Action')
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
'date_created_tesim' => '2000-01-01' }
end
let(:document) { SolrDocument.new(parent_collection_doc) }
let(:subject) { render('show_parent_collection_row.html.erb', id: child_collection.id, document: document) }
let(:subject) { render('show_parent_collection_row', id: child_collection.id, document: document) }

context 'when user cannot edit the child collection' do
before do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
'date_created_tesim' => '2000-01-01'
}
end
let(:subject) { render('show_parent_collections.html.erb', presenter: presenter) }
let(:subject) { render('show_parent_collections', presenter: presenter) }
let(:ability) { double }
let(:solr_document) { SolrDocument.new(collection_doc) }
let(:presenter) { Hyrax::CollectionPresenter.new(solr_document, ability) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
let(:user) { create :user }
let(:ability) { instance_double("Ability") }
let(:collection) { stub_model(Collection, id: '123') }
let(:subject) { render('subcollection_list.html.erb', id: collection.id, collection: subcollection) }
let(:subject) { render('subcollection_list', id: collection.id, collection: subcollection) }

before do
allow(view).to receive(:id).and_return(collection.id)
Expand All @@ -19,7 +19,7 @@
end

it "posts a warning message" do
render('subcollection_list.html.erb', collection: subcollection)
render('subcollection_list', collection: subcollection)
expect(rendered).to have_text("There are no visible subcollections.")
end
end
Expand Down
4 changes: 2 additions & 2 deletions spec/views/hyrax/file_sets/_single_use_links.html.erb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
context "with no single-use links" do
before do
allow(presenter).to receive(:single_use_links).and_return([])
render 'hyrax/file_sets/single_use_links.html.erb', presenter: presenter
render 'hyrax/file_sets/single_use_links', presenter: presenter
end
it "renders a table with no links" do
expect(rendered).to include("<tr><td>No links have been generated</td></tr>")
Expand All @@ -22,7 +22,7 @@
before do
controller.params = { id: "1234" }
allow(presenter).to receive(:single_use_links).and_return([link_presenter])
render 'hyrax/file_sets/single_use_links.html.erb', presenter: presenter
render 'hyrax/file_sets/single_use_links', presenter: presenter
end
it "renders a table with links" do
expect(rendered).to include("Link sha2ha expires in 23 hours")
Expand Down

0 comments on commit e6bf157

Please sign in to comment.