Skip to content

Commit

Permalink
Merge pull request #6262 from samvera/coll-ability
Browse files Browse the repository at this point in the history
skip ActiveFedora specific setup and tests for CollectionAbility
  • Loading branch information
hackartisan authored Aug 30, 2023
2 parents 1f42115 + 4f4a81f commit 8cf4801
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions spec/abilities/collection_ability_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,26 @@
let(:collection_type) { FactoryBot.create(:collection_type) }
let(:collection_type_gid) { collection_type.to_global_id }

# rubocop:disable RSpec/InstanceVariable
before :all do
@current_collection_model = Hyrax.config.collection_model

# abilities always test Hyrax::PcdmCollection, but only test Collection
# if it is configured as the collection_model
Hyrax.config.collection_model = 'Collection'
# abilities always test Hyrax::PcdmCollection, but only test Collection
# if it is configured as the collection_model
around(:each) do |example|
current_collection_model = Hyrax.config.collection_model
Hyrax.config.collection_model = 'Collection' unless Hyrax.config.disable_wings

example.run
Hyrax.config.collection_model = current_collection_model
end

after :all do
Hyrax.config.collection_model = @current_collection_model
end
# rubocop:enable RSpec/InstanceVariable

# rubocop:disable RSpec/ExampleLength
context 'when admin user' do
let(:current_user) { admin }
let(:admin) { FactoryBot.create(:admin, email: 'admin@example.com') }

context 'and collection is an ActiveFedora::Base' do
context 'and collection is an ActiveFedora::Base', :active_fedora do
let!(:collection) do
FactoryBot.build(:collection_lw, id: 'col_au',
user: user,
Expand Down Expand Up @@ -91,7 +91,7 @@
let(:current_user) { manager }
let(:manager) { FactoryBot.create(:user, email: 'manager@example.com') }

context 'and collection is an ActiveFedora::Base' do
context 'and collection is an ActiveFedora::Base', :active_fedora do
let!(:collection) do
FactoryBot.build(:collection_lw, id: 'col_mu',
user: user,
Expand Down Expand Up @@ -177,7 +177,7 @@
let(:current_user) { depositor }
let(:depositor) { FactoryBot.create(:user, email: 'depositor@example.com') }

context 'and collection is an ActiveFedora::Base' do
context 'and collection is an ActiveFedora::Base', :active_fedora do
let!(:collection) do
FactoryBot.build(:collection_lw, id: 'col_du',
user: user,
Expand Down Expand Up @@ -265,7 +265,7 @@
let(:current_user) { viewer }
let(:viewer) { FactoryBot.create(:user, email: 'viewer@example.com') }

context 'and collection is an ActiveFedora::Base' do
context 'and collection is an ActiveFedora::Base', :active_fedora do
let!(:collection) do
FactoryBot.build(:collection_lw, id: 'col_vu',
user: user,
Expand Down Expand Up @@ -351,7 +351,7 @@
let(:current_user) { other_user }
let(:other_user) { FactoryBot.create(:user, email: 'other_user@example.com') }

context 'and collection is an ActiveFedora::Base' do
context 'and collection is an ActiveFedora::Base', :active_fedora do
let!(:collection) do
FactoryBot.create(:collection_lw, id: 'as',
user: user,
Expand Down

0 comments on commit 8cf4801

Please sign in to comment.