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