diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-19 10:33:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-19 10:33:21 +0300 |
commit | 36a59d088eca61b834191dacea009677a96c052f (patch) | |
tree | e4f33972dab5d8ef79e3944a9f403035fceea43f /spec/models/project_setting_spec.rb | |
parent | a1761f15ec2cae7c7f7bbda39a75494add0dfd6f (diff) |
Add latest changes from gitlab-org/gitlab@15-0-stable-eev15.0.0-rc42
Diffstat (limited to 'spec/models/project_setting_spec.rb')
-rw-r--r-- | spec/models/project_setting_spec.rb | 18 |
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 |