diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2017-02-16 14:27:37 +0300 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2017-02-16 14:30:32 +0300 |
commit | 46082f4b652cac097c72354b394881a128fd3a5f (patch) | |
tree | 0e54261fae56bb59a178f03b3473f7939201dbca /spec/models/application_setting_spec.rb | |
parent | 3acf4fbe3b6e96ac4bc438e24030fde076832b51 (diff) |
Use static error message and don't give booleans
in validation. Feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/9219#note_23437431
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/9219#note_23437868
Diffstat (limited to 'spec/models/application_setting_spec.rb')
-rw-r--r-- | spec/models/application_setting_spec.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/spec/models/application_setting_spec.rb b/spec/models/application_setting_spec.rb index 9629f858609..719eda9b5b3 100644 --- a/spec/models/application_setting_spec.rb +++ b/spec/models/application_setting_spec.rb @@ -34,12 +34,16 @@ describe ApplicationSetting, models: true do setting.update(default_artifacts_expire_in: 'a') expect(setting).to be_invalid + expect(setting.errors.messages) + .to have_key(:default_artifacts_expiration) end it 'does not allow 0' do setting.update(default_artifacts_expire_in: '0') expect(setting).to be_invalid + expect(setting.errors.messages) + .to have_key(:default_artifacts_expiration) end it 'sets the value if it is valid' do |