diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 11:27:35 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 11:27:35 +0300 |
commit | 7e9c479f7de77702622631cff2628a9c8dcbc627 (patch) | |
tree | c8f718a08e110ad7e1894510980d2155a6549197 /spec/lib/gitlab/ci/charts_spec.rb | |
parent | e852b0ae16db4052c1c567d9efa4facc81146e88 (diff) |
Add latest changes from gitlab-org/gitlab@13-6-stable-eev13.6.0-rc42
Diffstat (limited to 'spec/lib/gitlab/ci/charts_spec.rb')
-rw-r--r-- | spec/lib/gitlab/ci/charts_spec.rb | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/spec/lib/gitlab/ci/charts_spec.rb b/spec/lib/gitlab/ci/charts_spec.rb index e00e5ed3920..cfc2019a89b 100644 --- a/spec/lib/gitlab/ci/charts_spec.rb +++ b/spec/lib/gitlab/ci/charts_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' RSpec.describe Gitlab::Ci::Charts do - context "yearchart" do + context 'yearchart' do let(:project) { create(:project) } let(:chart) { Gitlab::Ci::Charts::YearChart.new(project) } @@ -16,9 +16,13 @@ RSpec.describe Gitlab::Ci::Charts do it 'starts at the beginning of the current year' do expect(chart.from).to eq(chart.to.years_ago(1).beginning_of_month.beginning_of_day) end + + it 'uses %B %Y as labels format' do + expect(chart.labels).to include(chart.from.strftime('%B %Y')) + end end - context "monthchart" do + context 'monthchart' do let(:project) { create(:project) } let(:chart) { Gitlab::Ci::Charts::MonthChart.new(project) } @@ -31,9 +35,13 @@ RSpec.describe Gitlab::Ci::Charts do it 'starts one month ago' do expect(chart.from).to eq(1.month.ago.beginning_of_day) end + + it 'uses %d %B as labels format' do + expect(chart.labels).to include(chart.from.strftime('%d %B')) + end end - context "weekchart" do + context 'weekchart' do let(:project) { create(:project) } let(:chart) { Gitlab::Ci::Charts::WeekChart.new(project) } @@ -46,9 +54,13 @@ RSpec.describe Gitlab::Ci::Charts do it 'starts one week ago' do expect(chart.from).to eq(1.week.ago.beginning_of_day) end + + it 'uses %d %B as labels format' do + expect(chart.labels).to include(chart.from.strftime('%d %B')) + end end - context "pipeline_times" do + context 'pipeline_times' do let(:project) { create(:project) } let(:chart) { Gitlab::Ci::Charts::PipelineTime.new(project) } |