diff options
author | Fabio Pitino <pitinofabio@gmail.com> | 2019-04-30 13:10:39 +0100 |
---|---|---|
committer | Fabio Pitino <pitinofabio@gmail.com> | 2019-05-02 09:20:47 +0100 |
commit | 2fcf80de3f153c928245446460daf2bf6bdfa7f1 (patch) | |
tree | 20e8dae93356d7fbc8282d29ab623b06a0dffd36 /spec | |
parent | acb55198b4a05a0b4ac2662bf68cfeb3d744ca01 (diff) | |
download | gitlab-ce-strip-attr-cron-in-pipeline-schedule.tar.gz |
Strip whitespace for PipelineSchedule#cronstrip-attr-cron-in-pipeline-schedule
Diffstat (limited to 'spec')
-rw-r--r-- | spec/models/ci/pipeline_schedule_spec.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/models/ci/pipeline_schedule_spec.rb b/spec/models/ci/pipeline_schedule_spec.rb index 81913f4a3b6..1bfc14d2839 100644 --- a/spec/models/ci/pipeline_schedule_spec.rb +++ b/spec/models/ci/pipeline_schedule_spec.rb @@ -35,6 +35,15 @@ describe Ci::PipelineSchedule do expect(pipeline_schedule).not_to be_valid end end + + context 'when cron contains trailing whitespaces' do + it 'strips the attribute' do + pipeline_schedule = build(:ci_pipeline_schedule, cron: ' 0 0 * * * ') + + expect(pipeline_schedule).to be_valid + expect(pipeline_schedule.cron).to eq('0 0 * * *') + end + end end describe '#set_next_run_at' do |