mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
More URL site settings into a onceoff job.
* Doing it in a post migration was a bad idea because the migration will fail if the site is down while trying to download uploads which points to the instance. This mainly affects self-hosters using `discourse_docker` where `./launcher rebuild` will take the existing container down.
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
require 'rails_helper'
|
||||
require_relative '../../../db/post_migrate/20181112013117_migrate_url_site_settings'
|
||||
|
||||
RSpec.describe MigrateUrlSiteSettings do
|
||||
RSpec.describe Jobs::MigrateUrlSiteSettings do
|
||||
before do
|
||||
SiteSetting.authorized_extensions = ''
|
||||
end
|
||||
@@ -42,12 +41,9 @@ RSpec.describe MigrateUrlSiteSettings do
|
||||
stub_request(:get, "http://test.discourse.awesome/some.ico")
|
||||
.to_return(status: 200, body: file_from_fixtures("smallest.ico").read)
|
||||
|
||||
begin
|
||||
STDOUT.stubs(:write)
|
||||
expect { MigrateUrlSiteSettings.new.up }.to change { Upload.count }.by(3)
|
||||
ensure
|
||||
STDOUT.unstub(:write)
|
||||
end
|
||||
expect do
|
||||
described_class.new.execute_onceoff({})
|
||||
end.to change { Upload.count }.by(3)
|
||||
|
||||
upload = Upload.find_by(original_filename: "logo.png")
|
||||
upload2 = Upload.find_by(original_filename: "logo_small.png")
|
||||
Reference in New Issue
Block a user