From 8823125eab3b9698c7fabecff5479b96aaea360c Mon Sep 17 00:00:00 2001 From: Bob Van Landuyt Date: Thu, 12 Oct 2017 16:35:59 +0200 Subject: Allow configuring the circuitbreaker through the API and UI --- spec/models/application_setting_spec.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'spec/models/application_setting_spec.rb') diff --git a/spec/models/application_setting_spec.rb b/spec/models/application_setting_spec.rb index 78cacf9ff5d..cf192691507 100644 --- a/spec/models/application_setting_spec.rb +++ b/spec/models/application_setting_spec.rb @@ -114,6 +114,19 @@ describe ApplicationSetting do it { expect(setting.repository_storages).to eq(['default']) } end + context 'circuitbreaker settings' do + [:circuitbreaker_failure_count_threshold, + :circuitbreaker_failure_wait_time, + :circuitbreaker_failure_reset_time, + :circuitbreaker_storage_timeout].each do |field| + it "Validates #{field} as number" do + is_expected.to validate_numericality_of(field) + .only_integer + .is_greater_than_or_equal_to(0) + end + end + end + context 'repository storages' do before do storages = { -- cgit v1.2.1