2020-03-25 17:16:02 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2021-07-07 12:57:42 -04:00
|
|
|
describe UploadsController, type: [: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
|
|
|
|
SiteSetting.secure_media = true
|
|
|
|
upload.update(secure: true)
|
|
|
|
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
|
|
|
|
sign_in(user)
|
|
|
|
freeze_time
|
|
|
|
get upload.short_path
|
2020-09-14 07:32:25 -04:00
|
|
|
|
2021-07-07 12:57:42 -04:00
|
|
|
expect(response.body).to include(RailsMultisite::ConnectionManagement.current_db)
|
2020-03-25 17:16:02 -04:00
|
|
|
end
|
|
|
|
end
|