2020-03-26 05:16:02 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2022-07-28 10:27:38 +08:00
|
|
|
RSpec.describe UploadsController, type: %i[multisite request] do
|
2020-03-26 05:16:02 +08:00
|
|
|
let!(:user) { Fabricate(:user) }
|
2021-07-08 00:57:42 +08:00
|
|
|
let(:upload) { Fabricate(:upload_s3) }
|
2020-03-26 05:16:02 +08:00
|
|
|
|
2021-07-08 00:57:42 +08:00
|
|
|
before do
|
|
|
|
setup_s3
|
2022-09-29 07:24:33 +08:00
|
|
|
SiteSetting.secure_uploads = true
|
2021-07-08 00:57:42 +08:00
|
|
|
upload.update(secure: true)
|
2024-06-20 16:33:01 +08:00
|
|
|
sign_in(user)
|
|
|
|
freeze_time
|
2021-07-08 00:57:42 +08:00
|
|
|
end
|
2020-03-26 05:16:02 +08:00
|
|
|
|
2021-07-08 00:57:42 +08: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 19:32:25 +08:00
|
|
|
|
2024-06-20 16:33:01 +08:00
|
|
|
expect(response).to redirect_to(/#{RailsMultisite::ConnectionManagement.current_db}/)
|
2020-03-26 05:16:02 +08:00
|
|
|
end
|
|
|
|
end
|