-
Notifications
You must be signed in to change notification settings - Fork 2
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
Showing
9 changed files
with
61 additions
and
2 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
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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# asychronous processing for endowed funds symphony call | ||
class EndowFundsJob < ActiveJob::Base | ||
include EndowFundsParams | ||
include SymphonyCgi | ||
queue_as :default | ||
|
||
def perform(*args) | ||
request_conn(args[0], args[1]) | ||
end | ||
end |
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
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
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
require 'rails_helper' | ||
|
||
RSpec.describe EndowFundsJob, type: :job do | ||
include ActiveJob::TestHelper | ||
|
||
subject(:job) { EndowFundsJob.perform_later('endow_rpt.cgi', email: 'test@stanford.edu') } | ||
|
||
it 'queues the job' do | ||
expect { job }.to change(ActiveJob::Base.queue_adapter.enqueued_jobs, :size).by(1) | ||
end | ||
|
||
it 'is in the default queue' do | ||
expect(EndowFundsJob.new.queue_name).to eq('default') | ||
end | ||
|
||
it 'executes perform' do | ||
# how to test request_conn(args[0], args[1])? | ||
perform_enqueued_jobs { job } | ||
end | ||
|
||
after do | ||
clear_enqueued_jobs | ||
clear_performed_jobs | ||
end | ||
end |