Use mastodon config namespace to load software update default value via config_for (#30534)
				
					
				
			This commit is contained in:
		@@ -27,9 +27,10 @@ RSpec.describe Admin::SystemCheck::SoftwareVersionCheck do
 | 
			
		||||
 | 
			
		||||
      context 'when checks are disabled' do
 | 
			
		||||
        around do |example|
 | 
			
		||||
          ClimateControl.modify UPDATE_CHECK_URL: '' do
 | 
			
		||||
            example.run
 | 
			
		||||
          end
 | 
			
		||||
          original = Rails.configuration.x.mastodon.software_update_url
 | 
			
		||||
          Rails.configuration.x.mastodon.software_update_url = ''
 | 
			
		||||
          example.run
 | 
			
		||||
          Rails.configuration.x.mastodon.software_update_url = original
 | 
			
		||||
        end
 | 
			
		||||
 | 
			
		||||
        it 'returns true' do
 | 
			
		||||
 
 | 
			
		||||
@@ -124,9 +124,10 @@ RSpec.describe SoftwareUpdateCheckService do
 | 
			
		||||
 | 
			
		||||
  context 'when update checking is disabled' do
 | 
			
		||||
    around do |example|
 | 
			
		||||
      ClimateControl.modify UPDATE_CHECK_URL: '' do
 | 
			
		||||
        example.run
 | 
			
		||||
      end
 | 
			
		||||
      original = Rails.configuration.x.mastodon.software_update_url
 | 
			
		||||
      Rails.configuration.x.mastodon.software_update_url = ''
 | 
			
		||||
      example.run
 | 
			
		||||
      Rails.configuration.x.mastodon.software_update_url = original
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    before do
 | 
			
		||||
@@ -148,9 +149,10 @@ RSpec.describe SoftwareUpdateCheckService do
 | 
			
		||||
    let(:update_check_url) { 'https://api.example.com/update_check' }
 | 
			
		||||
 | 
			
		||||
    around do |example|
 | 
			
		||||
      ClimateControl.modify UPDATE_CHECK_URL: 'https://api.example.com/update_check' do
 | 
			
		||||
        example.run
 | 
			
		||||
      end
 | 
			
		||||
      original = Rails.configuration.x.mastodon.software_update_url
 | 
			
		||||
      Rails.configuration.x.mastodon.software_update_url = 'https://api.example.com/update_check'
 | 
			
		||||
      example.run
 | 
			
		||||
      Rails.configuration.x.mastodon.software_update_url = original
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    it_behaves_like 'when the feature is enabled'
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user