Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/project_setting_spec.rb')
-rw-r--r--spec/models/project_setting_spec.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/models/project_setting_spec.rb b/spec/models/project_setting_spec.rb
index d03eb3c8bfe..867ad843406 100644
--- a/spec/models/project_setting_spec.rb
+++ b/spec/models/project_setting_spec.rb
@@ -3,6 +3,7 @@
require 'spec_helper'
RSpec.describe ProjectSetting, type: :model do
+ using RSpec::Parameterized::TableSyntax
it { is_expected.to belong_to(:project) }
describe 'validations' do
@@ -27,6 +28,23 @@ RSpec.describe ProjectSetting, type: :model do
end
end
+ describe '#human_squash_option' do
+ where(:squash_option, :human_squash_option) do
+ 'never' | 'Do not allow'
+ 'always' | 'Require'
+ 'default_on' | 'Encourage'
+ 'default_off' | 'Allow'
+ end
+
+ with_them do
+ let(:project_setting) { create(:project_setting, squash_option: ProjectSetting.squash_options[squash_option]) }
+
+ subject { project_setting.human_squash_option }
+
+ it { is_expected.to eq(human_squash_option) }
+ end
+ end
+
def valid_target_platform_combinations
target_platforms = described_class::ALLOWED_TARGET_PLATFORMS