Skip to content

Commit

Permalink
Removing commented references to ActiveStorage
Browse files Browse the repository at this point in the history
  • Loading branch information
jrgriffiniii committed Jan 9, 2025
1 parent 31ddd43 commit ddbb448
Show file tree
Hide file tree
Showing 9 changed files with 0 additions and 29 deletions.
6 changes: 0 additions & 6 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
# frozen_string_literal: true
class ApplicationController < ActionController::Base
# This is necessary only for localhost development, with storage configured for the filesystem,
# but it shouldn't cause problems in other environments that use S3.
# Including this concern lets the disk service generate URLs using
# the same host, protocol, and port as the current request.
# include ActiveStorage::SetCurrent

protect_from_forgery with: :exception
before_action :authenticate_user!

Expand Down
3 changes: 0 additions & 3 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@
config.cache_store = :null_store
end

# Store uploaded files on amazon (see config/storage.yml for options).
# config.active_storage.service = :local

config.action_mailer.perform_caching = false

config.action_mailer.default_options = {
Expand Down
3 changes: 0 additions & 3 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX

# Store uploaded files on the local file system (see config/storage.yml for options).
# config.active_storage.service = :local

# Mount Action Cable outside main process or domain.
# config.action_cable.mount_path = nil
# config.action_cable.url = 'wss://example.com/cable'
Expand Down
3 changes: 0 additions & 3 deletions config/environments/staging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX

# Store uploaded files on the local file system (see config/storage.yml for options).
# config.active_storage.service = :local

# Mount Action Cable outside main process or domain.
# config.action_cable.mount_path = nil
# config.action_cable.url = 'wss://example.com/cable'
Expand Down
3 changes: 0 additions & 3 deletions config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@
# Disable request forgery protection in test environment.
config.action_controller.allow_forgery_protection = false

# Store uploaded files on the local file system in a temporary directory.
# config.active_storage.service = :test

config.action_mailer.perform_caching = false

# Tell Action Mailer not to deliver emails to the real world.
Expand Down
4 changes: 0 additions & 4 deletions spec/controllers/works_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
Group.create_defaults
user
stub_datacite(host: "api.datacite.org", body: datacite_register_body(prefix: "10.34770"))
# allow(ActiveStorage::PurgeJob).to receive(:new).and_call_original

stub_request(:get, /#{Regexp.escape('https://example-bucket.s3.amazonaws.com/us_covid_20')}.*\.csv/).to_return(status: 200, body: "", headers: {})
end
Expand Down Expand Up @@ -76,7 +75,6 @@
work.reload
expect(work.resource_type).to eq("Dataset")
expect(work.resource_type_general).to eq("Dataset")
# expect(ActiveStorage::PurgeJob).not_to have_received(:new)
end

it "handles the reordering the creators on the update page" do
Expand Down Expand Up @@ -366,7 +364,6 @@

expect(saved_work.pre_curation_uploads.length).to eq(1)

# expect(ActiveStorage::PurgeJob).not_to have_received(:new)
expect(fake_s3_service).to have_received(:delete_s3_object).with(s3_file1.key)
expect(fake_s3_service).to have_received(:delete_s3_object).with(s3_file3.key)
expect(fake_s3_service).not_to have_received(:delete_s3_object).with(s3_file2.key)
Expand Down Expand Up @@ -428,7 +425,6 @@
post :update, params: params_no_delete

expect(response).to redirect_to(work_path(work))
# expect(ActiveStorage::PurgeJob).not_to have_received(:new)
end
end
end
Expand Down
2 changes: 0 additions & 2 deletions spec/controllers/works_wizard_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
Group.create_defaults
user
stub_datacite(host: "api.datacite.org", body: datacite_register_body(prefix: "10.34770"))
# allow(ActiveStorage::PurgeJob).to receive(:new).and_call_original

stub_request(:get, /#{Regexp.escape('https://example-bucket.s3.amazonaws.com/us_covid_20')}.*\.csv/).to_return(status: 200, body: "", headers: {})
end
Expand Down Expand Up @@ -46,7 +45,6 @@
post(:update_wizard, params:)
expect(response.status).to be 302
expect(response.location).to eq "http://test.host/works/#{work.id}/update-additional"
# expect(ActiveStorage::PurgeJob).not_to have_received(:new)
end

context "save and stay on page" do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
Group.create_defaults
user
stub_datacite(host: "api.datacite.org", body: datacite_register_body(prefix: "10.34770"))
# allow(ActiveStorage::PurgeJob).to receive(:new).and_call_original

stub_request(:get, /#{Regexp.escape('https://example-bucket.s3.amazonaws.com/us_covid_20')}.*\.csv/).to_return(status: 200, body: "", headers: {})
end
Expand Down Expand Up @@ -45,7 +44,6 @@
patch(:update_additional_save, params:)
expect(response.status).to be 302
expect(response.location).to eq "http://test.host/works/#{work.id}/readme-select"
# expect(ActiveStorage::PurgeJob).not_to have_received(:new)
end

context "save and stay on page" do
Expand Down
3 changes: 0 additions & 3 deletions spec/system/work_edit_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
end

it "allows users to delete one of the uploads" do
# allow(ActiveStorage::PurgeJob).to receive(:new).and_call_original
allow(fake_s3_service).to receive(:client_s3_files).and_return([contents1, contents2], [contents2])

expect(page).to have_content "Filename"
Expand All @@ -63,7 +62,6 @@
end

it "allows users to cancel the delete of one of the uploads" do
# allow(ActiveStorage::PurgeJob).to receive(:new).and_call_original
allow(fake_s3_service).to receive(:client_s3_files).and_return([contents1, contents2], [contents2])

expect(page).to have_link "us_covid_2019.csv"
Expand All @@ -76,7 +74,6 @@
end

it "allows users to replace one of the uploads" do
# allow(ActiveStorage::PurgeJob).to receive(:new).and_call_original
expect(page).to have_content "Filename"
expect(page).to have_content "Last Modified"
expect(page).to have_content "Size"
Expand Down

0 comments on commit ddbb448

Please sign in to comment.