Skip to content

Commit

Permalink
Update export_job_test.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
ewlarson committed Dec 3, 2024
1 parent fec333c commit 1f74ed9
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions test/jobs/export_job_test.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,26 @@
require "test_helper"

class ExportJobTest < ActiveJob::TestCase
# test "the truth" do
# assert true
# end
end
setup do
@request = "http://localhost:3000"
@current_user = users(:user_001) # Assuming you have a fixture for users
@query_params = { ids: [1, 2, 3] }
@export_service = ExportCsvService
end

test "job is enqueued" do
assert_enqueued_with(job: ExportJob) do
ExportJob.perform_later(@request, @current_user, @query_params, @export_service)
end
end

test "job is performed" do
perform_enqueued_jobs do
ExportJob.perform_later(@request, @current_user, @query_params, @export_service)
end

# Add assertions to verify the expected behavior
# For example, check if the notification was delivered
assert @current_user.notifications.any?
end
end

0 comments on commit 1f74ed9

Please sign in to comment.