2020-03-25 17:16:02 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2022-07-27 22:27:38 -04:00
|
|
|
RSpec.describe UploadsController, type: %i[multisite request] do
|
2020-03-25 17:16:02 -04:00
|
|
|
let!(:user) { Fabricate(:user) }
|
2021-07-07 12:57:42 -04:00
|
|
|
let(:upload) { Fabricate(:upload_s3) }
|
2020-03-25 17:16:02 -04:00
|
|
|
|
2021-07-07 12:57:42 -04:00
|
|
|
before do
|
|
|
|
setup_s3
|
2022-09-28 19:24:33 -04:00
|
|
|
SiteSetting.secure_uploads = true
|
2021-07-07 12:57:42 -04:00
|
|
|
upload.update(secure: true)
|
2024-06-20 04:33:01 -04:00
|
|
|
sign_in(user)
|
|
|
|
freeze_time
|
2021-07-07 12:57:42 -04:00
|
|
|
end
|
2020-03-25 17:16:02 -04:00
|
|
|
|
2021-07-07 12:57:42 -04:00
|
|
|
it "redirects to the signed_url_for_path with the multisite DB name in the url" do
|
|
|
|
get upload.short_path
|
2020-09-14 07:32:25 -04:00
|
|
|
|
2024-06-20 04:33:01 -04:00
|
|
|
expect(response).to redirect_to(/#{RailsMultisite::ConnectionManagement.current_db}/)
|
2020-03-25 17:16:02 -04:00
|
|
|
end
|
|
|
|
end
|