Skip to content

Commit

Permalink
Unskip some ActiveJob tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Dolski committed Apr 18, 2024
1 parent cae26b6 commit 1de8001
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 21 deletions.
15 changes: 3 additions & 12 deletions test/controllers/imports_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,10 @@ class ImportsControllerTest < ActionDispatch::IntegrationTest
end

test "complete_upload() invokes an ImportJob" do
skip # TODO: why doesn't the job run?
log_in_as(users(:southwest_admin))
assert_difference "Item.count" do
package_root = File.join(file_fixture_path, "/packages/csv")
csv_package = File.join(Dir.tmpdir, "test.zip")
`cd "#{package_root}" && rm -f #{csv_package} && zip -r "#{csv_package}" valid_items`
@import.update!(filename: File.basename(csv_package),
length: File.size(csv_package))
ObjectStore.instance.put_object(key: @import.file_key,
path: csv_package)

post import_complete_upload_path(@import)
end

post import_complete_upload_path(@import)
assert_equal 1, enqueued_jobs.select{ |j| j['job_class'] == "ImportJob" }.count
end

test "complete_upload() returns HTTP 204 upon success" do
Expand Down
6 changes: 3 additions & 3 deletions test/controllers/institutions_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -690,13 +690,13 @@ class InstitutionsControllerTest < ActionDispatch::IntegrationTest
end

test "refresh_saml_config_metadata() updates an institution's SAML metadata" do
skip # TODO: why isn't the job executing in the test environment?
user = users(:southwest_admin)
log_in_as(user)
institution = user.institution
patch institution_refresh_saml_config_metadata_path(institution)
institution.reload
assert_not_nil institution.saml_idp_signing_cert

assert_equal 1, enqueued_jobs.
select{ |j| j['job_class'] == "RefreshSamlConfigMetadataJob" }.count
end

test "refresh_saml_config_metadata() returns HTTP 302" do
Expand Down
9 changes: 3 additions & 6 deletions test/controllers/users_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -619,15 +619,12 @@ class UsersControllerTest < ActionDispatch::IntegrationTest
end

test "update_submittable_collections() updates a user's submittable collections" do
skip # TODO: figure out why jobs aren't running in test
user = users(:southwest)
collection = collections(:southwest_unit1_collection1)
collection.submitting_users << user
collection.save!
log_in_as(user)
patch user_update_submittable_collections_path(user), xhr: true
user.reload
assert_not_empty user.cached_submittable_collections

assert_equal 2, enqueued_jobs. # 2 because 1 is also fired off at login
select{ |j| j['job_class'] == "CacheSubmittableCollectionsJob" }.count
end

test "update_submittable_collections() redirects to the created Task" do
Expand Down

0 comments on commit 1de8001

Please sign in to comment.