Просмотр исходного кода

Maintenance: Stabilize CI run Setting::Validation::Saml::TLS.

Tobias Schäfer 1 год назад
Родитель
Сommit
a6a46abbfc
1 измененных файлов с 5 добавлено и 0 удалено
  1. 5 0
      spec/models/setting/validation/saml/tls_spec.rb

+ 5 - 0
spec/models/setting/validation/saml/tls_spec.rb

@@ -41,6 +41,11 @@ RSpec.describe Setting::Validation::Saml::TLS do
       let(:ssl_verify) { true }
       let(:ssl_verify) { true }
 
 
       it 'raises an error' do
       it 'raises an error' do
+        if ENV['CI'].present?
+          result = UserAgent::Result.new(success: false, error: '#<OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 peeraddr=')
+          allow(UserAgent).to receive(:get).and_return(result)
+        end
+
         expect { Setting.set(setting_name, setting_value) }.to raise_error(ActiveRecord::RecordInvalid, 'Validation failed: The verification of the TLS connection failed. Please check the IDP certificate.')
         expect { Setting.set(setting_name, setting_value) }.to raise_error(ActiveRecord::RecordInvalid, 'Validation failed: The verification of the TLS connection failed. Please check the IDP certificate.')
       end
       end
     end
     end