-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dc49d62
commit 7244114
Showing
1 changed file
with
21 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |