Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use valkyrie for setup on _form_relationships partial spec #6281

Merged
merged 3 commits into from
Aug 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -178,19 +178,12 @@ def clean_active_fedora_repository

config.before(:each, type: :view) do
initialize_controller_helpers(view)
# disallow network connections to services within the stack for view specs;
# no db/metadata/index calls
WebMock.disable_net_connect!(allow_localhost: false, allow: 'chromedriver.storage.googleapis.com')

allow(Hyrax)
.to receive(:metadata_adapter)
.and_return(Valkyrie::MetadataAdapter.find(:test_adapter))
end

config.after(:each, type: :view) do
WebMock.disable_net_connect!(allow_localhost: true, allow: allowed_hosts)
end

config.before(:all, type: :feature) do
# Assets take a long time to compile. This causes two problems:
# 1) the profile will show the first feature test taking much longer than it
Expand Down
6 changes: 3 additions & 3 deletions spec/views/hyrax/base/_form_relationships.html.erb_spec.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# frozen_string_literal: true
RSpec.describe 'hyrax/base/_form_relationships.html.erb', type: :view do
let(:ability) { double }
let(:work) { GenericWork.new }
let(:work) { FactoryBot.build(:monograph) }
let(:form) do
Hyrax::GenericWorkForm.new(work, ability, controller)
Hyrax::Forms::ResourceForm.for(work).prepopulate!
end
let(:service) { instance_double Hyrax::AdminSetService }
let(:presenter) { instance_double Hyrax::AdminSetOptionsPresenter, select_options: [] }
Expand Down Expand Up @@ -34,7 +34,7 @@

it "draws the page" do
expect(page).to have_content('Administrative Set')
expect(page).to have_selector('select#generic_work_admin_set_id')
expect(page).to have_selector('select#monograph_admin_set_id')
end
end

Expand Down