Commit 8e9f85ba authored by Dmitry Gruzd's avatar Dmitry Gruzd

Fix ES replicas setting validation

parent 328d1b1e
...@@ -46,7 +46,7 @@ module EE ...@@ -46,7 +46,7 @@ module EE
validates :elasticsearch_replicas, validates :elasticsearch_replicas,
presence: true, presence: true,
numericality: { only_integer: true, greater_than: 0 } numericality: { only_integer: true, greater_than_or_equal_to: 0 }
validates :elasticsearch_max_bulk_size_mb, validates :elasticsearch_max_bulk_size_mb,
presence: true, presence: true,
......
...@@ -36,8 +36,8 @@ describe ApplicationSetting do ...@@ -36,8 +36,8 @@ describe ApplicationSetting do
it { is_expected.not_to allow_value(-1).for(:elasticsearch_shards) } it { is_expected.not_to allow_value(-1).for(:elasticsearch_shards) }
it { is_expected.to allow_value(10).for(:elasticsearch_replicas) } it { is_expected.to allow_value(10).for(:elasticsearch_replicas) }
it { is_expected.to allow_value(0).for(:elasticsearch_replicas) }
it { is_expected.not_to allow_value(nil).for(:elasticsearch_replicas) } it { is_expected.not_to allow_value(nil).for(:elasticsearch_replicas) }
it { is_expected.not_to allow_value(0).for(:elasticsearch_replicas) }
it { is_expected.not_to allow_value(1.1).for(:elasticsearch_replicas) } it { is_expected.not_to allow_value(1.1).for(:elasticsearch_replicas) }
it { is_expected.not_to allow_value(-1).for(:elasticsearch_replicas) } it { is_expected.not_to allow_value(-1).for(:elasticsearch_replicas) }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment