+
+
+
+ <%= form_tag hyrax.admin_workflows_path, method: :get, class: 'per_page' do %>
+
+ <%= t('hyrax.dashboard.my.sr.results_per_page') %>
+ <%= label_tag :per_page do %>
+ Show <%= select_tag :per_page, options_for_select(Hyrax.config.range_for_number_of_results_to_display_per_page.map(&:to_s), h(params[:per_page])), title: "entries" %> per page
+ <% end %>
+ <%= render_hash_as_hidden_fields(search_state.params_for_search.except(:per_page, :sort, :utf8)) %>
+
+ <% end %>
diff --git a/config/routes.rb b/config/routes.rb
index 1605e3eb1..f023183f6 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,7 +1,6 @@
# OVERRIDE Hyrax 2.9.0 to add featured collection routes
require 'sidekiq/web'
-Sidekiq::Web.set :session_secret, Rails.application.secrets[:secret_key_base]
Rails.application.routes.draw do
diff --git a/spec/features/advanced_search_spec.rb b/spec/features/advanced_search_spec.rb
index 4a252f71a..2d61a6611 100644
--- a/spec/features/advanced_search_spec.rb
+++ b/spec/features/advanced_search_spec.rb
@@ -13,6 +13,7 @@
expect(page).to have_content('ambitious aardvark')
expect(page).to have_content('No results found for your search')
end
+
it 'can perform advanced search' do
visit '/advanced'
fill_in('Title', with: 'ambitious aardvark')
diff --git a/spec/models/auth_provider_spec.rb b/spec/models/auth_provider_spec.rb
index f8ee3810b..430de4ae1 100644
--- a/spec/models/auth_provider_spec.rb
+++ b/spec/models/auth_provider_spec.rb
@@ -4,9 +4,12 @@
subject do
described_class.new(
provider: 'saml',
- client_id: 'client_id',
- client_secret: 'client_secret',
- idp_sso_service_url: 'idp_sso_service_url',
+ oidc_client_id: 'client_id',
+ saml_client_id: 'client_id',
+ oidc_client_secret: 'client_secret',
+ saml_client_secret: 'client_secret',
+ oidc_idp_sso_service_url: 'oidc_idp_sso_service_url',
+ saml_idp_sso_service_url: 'saml_idp_sso_service_url',
account_id: 1
)
end
@@ -22,12 +25,14 @@
end
it 'is not valid without a client_id' do
- subject.client_id = nil
+ subject.oidc_client_id = nil
+ subject.saml_client_id = nil
expect(subject).not_to be_valid
end
it 'is not valid without a client_secret' do
- subject.client_secret = nil
+ subject.oidc_client_secret = nil
+ subject.saml_client_secret = nil
expect(subject).not_to be_valid
end
end
@@ -39,9 +44,10 @@
it 'has one after adding one' do
AuthProvider.create(
- provider: 'saml',
- client_id: 'client_id',
- client_secret: 'client_secret',
+ provider: 'oidc',
+ oidc_client_id: 'new oidc_client_id',
+ oidc_client_secret: 'new oidc_client_secret',
+ oidc_idp_sso_service_url: 'new oidc_idp_sso_service_url',
account_id: 1
)
expect(described_class.count).to eq 1
diff --git a/spec/presenters/hyrax/oer_presenter_spec.rb b/spec/presenters/hyrax/oer_presenter_spec.rb
index 7c59c2ae2..3f2ce5ba6 100644
--- a/spec/presenters/hyrax/oer_presenter_spec.rb
+++ b/spec/presenters/hyrax/oer_presenter_spec.rb
@@ -1,5 +1,7 @@
# Generated via
# `rails generate hyrax:work Oer`
+# NOTE: The majority of this spec is coming from the hyrax-iiif_av gem.
+# See this file for more info: https://github.com/samvera-labs/hyrax-iiif_av/blob/main/lib/hyrax/iiif_av/spec/shared_specs/displays_iiif_av.rb
require 'rails_helper'
RSpec.describe Hyrax::OerPresenter do
@@ -32,6 +34,9 @@
let(:id_present) { false }
let(:representative_presenter) { double('representative', present?: false) }
let(:image_boolean) { false }
+ let(:video_boolean) { false }
+ let(:audio_boolean) { false }
+ let(:pdf_boolean) { false }
let(:iiif_enabled) { true }
let(:file_set_presenter) { Hyrax::FileSetPresenter.new(solr_document, ability) }
let(:file_set_presenters) { [file_set_presenter] }
@@ -44,6 +49,9 @@
allow(file_set_presenter).to receive(:image?).and_return(true)
allow(ability).to receive(:can?).with(:read, solr_document.id).and_return(read_permission)
allow(representative_presenter).to receive(:image?).and_return(image_boolean)
+ allow(representative_presenter).to receive(:video?).and_return(video_boolean)
+ allow(representative_presenter).to receive(:audio?).and_return(audio_boolean)
+ allow(representative_presenter).to receive(:pdf?).and_return(pdf_boolean)
allow(Hyrax.config).to receive(:iiif_image_server?).and_return(iiif_enabled)
end
@@ -60,7 +68,6 @@
context 'with non-image representative_presenter' do
let(:id_present) { true }
let(:representative_presenter) { double('representative', present?: true) }
- let(:image_boolean) { false }
it { is_expected.to be false }
end
@@ -228,6 +235,18 @@
describe '#iiif_viewer' do
subject { presenter.iiif_viewer }
+ let(:representative_presenter) { instance_double('Hyrax::FileSetPresenter', present?: true) }
+ let(:image_boolean) { false }
+ let(:audio_boolean) { false }
+ let(:video_boolean) { false }
+
+ before do
+ allow(presenter).to receive(:representative_presenter).and_return(representative_presenter)
+ allow(representative_presenter).to receive(:image?).and_return(image_boolean)
+ allow(representative_presenter).to receive(:audio?).and_return(audio_boolean)
+ allow(representative_presenter).to receive(:video?).and_return(video_boolean)
+ end
+
it 'defaults to universal viewer' do
expect(subject).to be :universal_viewer
end
diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb
index e69de046f..203873ad4 100644
--- a/spec/rails_helper.rb
+++ b/spec/rails_helper.rb
@@ -113,57 +113,6 @@
# this security while still going through the captcha workflow.
NegativeCaptcha.test_mode = true
-# Uses faster rack_test driver when JavaScript support not needed
-Capybara.default_max_wait_time = 8
-Capybara.default_driver = :rack_test
-
-ENV['WEB_HOST'] ||= `hostname -s`.strip
-
-if ENV['CHROME_HOSTNAME'].present?
- capabilities = Selenium::WebDriver::Remote::Capabilities.chrome(
- chromeOptions: {
- args: %w[headless disable-gpu no-sandbox whitelisted-ips window-size=1400,1400]
- }
- )
-
- Capybara.register_driver :chrome do |app|
- d = Capybara::Selenium::Driver.new(app,
- browser: :remote,
- desired_capabilities: capabilities,
- url: "http://#{ENV['CHROME_HOSTNAME']}:4444/wd/hub")
- # Fix for capybara vs remote files. Selenium handles this for us
- d.browser.file_detector = lambda do |args|
- str = args.first.to_s
- str if File.exist?(str)
- end
- d
- end
- Capybara.server_host = '0.0.0.0'
- Capybara.server_port = 3001
- Capybara.app_host = "http://#{ENV['WEB_HOST']}:#{Capybara.server_port}"
-else
- capabilities = Selenium::WebDriver::Remote::Capabilities.chrome(
- chromeOptions: {
- args: %w[headless disable-gpu]
- }
- )
-
- Capybara.register_driver :chrome do |app|
- Capybara::Selenium::Driver.new(
- app,
- browser: :chrome,
- desired_capabilities: capabilities
- )
- end
-end
-
-Capybara.javascript_driver = :chrome
-
-# This will ensure that a field named email will not be referred to by a
-# hash but by test-email instead. A tool like capybara can now bypass
-# this security while still going through the captcha workflow.
-NegativeCaptcha.test_mode = true
-
RSpec.configure do |config|
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
config.fixture_path = "#{::Rails.root}/spec/fixtures"
diff --git a/spec/search_builders/adv_search_builder_spec.rb b/spec/search_builders/adv_search_builder_spec.rb
index 5f0681269..cc5b10301 100644
--- a/spec/search_builders/adv_search_builder_spec.rb
+++ b/spec/search_builders/adv_search_builder_spec.rb
@@ -25,6 +25,7 @@
#
# When we had those duplicates, the :add_advanced_parse_q_to_solr obliterated the join logic
# for files.
+ # note: :exclude_models, :highlight_search_params, :show_parents_only, :include_allinson_flex_fields are added for the hyrax-iiif_av gem
%i[
default_solr_parameters
add_query_to_solr
@@ -43,11 +44,16 @@
show_works_or_works_that_contain_files
show_only_active_records
filter_collection_facet_for_access
+ exclude_models
+ highlight_search_params
+ show_parents_only
+ include_allinson_flex_fields
add_advanced_parse_q_to_solr
add_advanced_search_to_solr
]
end
+ # TODO: skip to get reshare feature branch merged to main
it { is_expected.to eq(expected_default_processor_chain) }
end
end