summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-01-04 14:32:48 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-01-04 14:32:48 +0000
commit298593fe47809cf87e4694db2c449461647eb5fc (patch)
tree26ff6de2f3968795c56aa094d34aa8f424d6b791
parentc97c8073a0e63b678c31ebba78ca2867db376c76 (diff)
downloadgitlab-ce-298593fe47809cf87e4694db2c449461647eb5fc.tar.gz
Add latest changes from gitlab-org/gitlab@13-7-stable-ee
-rw-r--r--spec/requests/api/graphql/project/project_pipeline_statistics_spec.rb14
1 files changed, 10 insertions, 4 deletions
diff --git a/spec/requests/api/graphql/project/project_pipeline_statistics_spec.rb b/spec/requests/api/graphql/project/project_pipeline_statistics_spec.rb
index 0f495f3e671..7d157563f5f 100644
--- a/spec/requests/api/graphql/project/project_pipeline_statistics_spec.rb
+++ b/spec/requests/api/graphql/project/project_pipeline_statistics_spec.rb
@@ -42,13 +42,19 @@ RSpec.describe 'rendering project pipeline statistics' do
expect(graphql_data_at(:project, :pipelineAnalytics, :weekPipelinesLabels).length).to eq(8)
end
- it "contains two arrays of 31 elements each for the month pipelines" do
- post_graphql(query, current_user: user)
+ shared_examples 'monthly statistics' do |timestamp, expected_quantity|
+ it "contains two arrays of #{expected_quantity} elements each for the month pipelines" do
+ travel_to(timestamp) { post_graphql(query, current_user: user) }
- expect(graphql_data_at(:project, :pipelineAnalytics, :monthPipelinesTotals).length).to eq(31)
- expect(graphql_data_at(:project, :pipelineAnalytics, :monthPipelinesLabels).length).to eq(31)
+ expect(graphql_data_at(:project, :pipelineAnalytics, :monthPipelinesTotals).length).to eq(expected_quantity)
+ expect(graphql_data_at(:project, :pipelineAnalytics, :monthPipelinesLabels).length).to eq(expected_quantity)
+ end
end
+ it_behaves_like 'monthly statistics', Time.zone.local(2019, 2, 28), 32
+ it_behaves_like 'monthly statistics', Time.zone.local(2020, 12, 30), 31
+ it_behaves_like 'monthly statistics', Time.zone.local(2020, 12, 31), 32
+
it "contains two arrays of 13 elements each for the year pipelines" do
post_graphql(query, current_user: user)