Skip to content

Commit

Permalink
🤖 Fix spec/features/collection_type_spec.rb
Browse files Browse the repository at this point in the history
There are three major changes:

1. Favor setting `collection_type` attribute instead of
   `collection_type_gid`
2. Change `#collections?` to `#collections#any?`
3. Change CSS selector based on Bootstrap upgrade

The above changes are related to work done in:

- samvera/hyrax#5730
- samvera/hyrax#5742
- samvera/hyrax#4701

See:
- samvera/hyrax@eb6e04e
- samvera/hyrax@237c0c6
- samvera/hyrax@280664b
  • Loading branch information
jeremyf committed Dec 20, 2023
1 parent f50b3f5 commit aa9a6d7
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions spec/features/collection_type_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -376,19 +376,15 @@

context 'when collections exist of this type' do
before do
create(
:public_collection_lw,
user: build(:user),
collection_type_gid: exhibit_collection_type.gid
)
FactoryBot.create(:public_collection_lw, user: build(:user), collection_type: exhibit_collection_type)

exhibit_collection_type
login_as admin_user
visit "/admin/collection_types/#{exhibit_collection_type.id}/edit"
end

it 'all settings are disabled', :js do
expect(exhibit_collection_type.collections?).to be true
expect(exhibit_collection_type.collections.any?).to be true

click_link('Settings', href: '#settings')

Expand Down Expand Up @@ -446,7 +442,7 @@
create(
:public_collection_lw,
user: admin_user,
collection_type_gid: not_empty_collection_type.gid
collection_type: not_empty_collection_type
)
end
# OVERRIDE: split deny_delete_modal_text into two variables since the test was failing over the newline character
Expand Down Expand Up @@ -474,7 +470,7 @@
end

# forwards to Dashboard -> Collections -> All Collections
within('li.active') do
within('.nav-tabs li.nav-item') do
expect(page).to have_link('All Collections')
end

Expand All @@ -492,7 +488,6 @@
end

# OVERRIDE: new (non-hyrax) test cases below

describe 'default collection type participants', ci: 'skip' do
let(:title) { 'Title Test' }

Expand Down

0 comments on commit aa9a6d7

Please sign in to comment.