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

Refactor GraduationJob test to be more resilient #2136

Merged
merged 1 commit into from
Apr 14, 2021
Merged
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
5 changes: 3 additions & 2 deletions spec/jobs/graduation_job_with_embargo_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# * update the embargo release date to the user's graduation date plus
# their requested embargo length
# * send notifications
describe GraduationJob, :clean, integration: true do
describe GraduationJob, integration: true do
context "a student with a requested embargo", :perform_jobs do
let(:w) { WorkflowSetup.new("#{fixture_path}/config/emory/superusers.yml", "#{fixture_path}/config/emory/candler_admin_sets.yml", "/dev/null") }
let(:user) { FactoryBot.create(:user) }
Expand Down Expand Up @@ -38,9 +38,10 @@
allow(Hyrax::Workflow::DegreeAwardedNotification).to receive(:send_notification)
ActiveJob::Base.queue_adapter.filter = [AttachFilesToWorkJob]
Hyrax::CurationConcern.actor.create(env)
@etd_with_embargo_requested = env.curation_concern.id
end
it "performs the graduation process" do
etd = Etd.last
etd = Etd.find(@etd_with_embargo_requested)
expect(etd.degree_awarded).to eq nil
expect(etd.embargo.embargo_release_date).to eq six_years_from_today
expect(etd.embargo_length).to eq "6 months"
Expand Down