Skip to content

Commit

Permalink
trying spec again
Browse files Browse the repository at this point in the history
  • Loading branch information
orangewolf committed Nov 13, 2024
1 parent dc49d62 commit 7244114
Showing 1 changed file with 21 additions and 23 deletions.
44 changes: 21 additions & 23 deletions spec/jobs/migrate_resources_job_spec.rb
Original file line number Diff line number Diff line change
@@ -1,31 +1,29 @@
# frozen_string_literal: true

# require 'freyja/persister'
# RSpec.describe MigrateResourcesJob, clean: true, index_adapter: :solr_index, valkyrie_adapter: :freyja_adapter do
# let(:af_file_set) { create(:file_set, title: ['TestFS']) }
require 'freyja/persister'
RSpec.describe MigrateResourcesJob, index_adapter: :solr_index, valkyrie_adapter: :freyja_adapter do
let(:af_file_set) { create(:file_set, title: ['TestFS']) }

# let!(:af_admin_set) do
# as = AdminSet.new(title: ['AF Admin Set'])
# as.save
# AdminSet.find(as.id)
# end
let!(:af_admin_set) do
as = AdminSet.new(title: ['AF Admin Set'])
as.save
AdminSet.find(as.id)
end

# describe '#perform' do
# it "migrates admin sets to valkyrie", active_fedora_to_valkyrie: true do
# expect(Valkyrie::Persistence::Postgres::ORM::Resource.find_by(id: af_admin_set.id.to_s)).to be_nil
describe '#perform' do
it "migrates admin sets to valkyrie", active_fedora_to_valkyrie: true do
expect(Valkyrie::Persistence::Postgres::ORM::Resource.find_by(id: af_admin_set.id.to_s)).to be_nil

# ActiveJob::Base.queue_adapter.perform_enqueued_jobs = true
# MigrateResourcesJob.perform_now(ids: [af_admin_set.id])
# expect(Valkyrie::Persistence::Postgres::ORM::Resource.find_by(id: af_admin_set.id.to_s)).to be_present
# end
MigrateResourcesJob.perform_now(ids: [af_admin_set.id])
expect(Valkyrie::Persistence::Postgres::ORM::Resource.find_by(id: af_admin_set.id.to_s)).to be_present
end

# it "migrates a file set by its id", active_fedora_to_valkyrie: true do
# expect(Valkyrie::Persistence::Postgres::ORM::Resource.find_by(id: af_file_set.id.to_s)).to be_nil
it "migrates a file set by its id", active_fedora_to_valkyrie: true do
expect(Valkyrie::Persistence::Postgres::ORM::Resource.find_by(id: af_file_set.id.to_s)).to be_nil

# ActiveJob::Base.queue_adapter.perform_enqueued_jobs = true
# MigrateResourcesJob.perform_now(ids: [af_file_set.id])
MigrateResourcesJob.perform_now(ids: [af_file_set.id])

# expect(Valkyrie::Persistence::Postgres::ORM::Resource.find_by(id: af_file_set.id.to_s)).to be_present
# end
# end
# end
expect(Valkyrie::Persistence::Postgres::ORM::Resource.find_by(id: af_file_set.id.to_s)).to be_present
end
end
end

0 comments on commit 7244114

Please sign in to comment.