diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-19 14:01:45 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-19 14:01:45 +0300 |
commit | 9297025d0b7ddf095eb618dfaaab2ff8f2018d8b (patch) | |
tree | 865198c01d1824a9b098127baa3ab980c9cd2c06 /spec/frontend/fixtures/pipeline_header.rb | |
parent | 6372471f43ee03c05a7c1f8b0c6ac6b8a7431dbe (diff) |
Add latest changes from gitlab-org/gitlab@16-7-stable-eev16.7.0-rc42
Diffstat (limited to 'spec/frontend/fixtures/pipeline_header.rb')
-rw-r--r-- | spec/frontend/fixtures/pipeline_header.rb | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/spec/frontend/fixtures/pipeline_header.rb b/spec/frontend/fixtures/pipeline_header.rb index 744df18a403..77d626100ad 100644 --- a/spec/frontend/fixtures/pipeline_header.rb +++ b/spec/frontend/fixtures/pipeline_header.rb @@ -18,18 +18,23 @@ RSpec.describe "GraphQL Pipeline Header", '(JavaScript fixtures)', type: :reques let_it_be(:pipeline) do create( :ci_pipeline, + :merged_result_pipeline, project: project, sha: commit.id, ref: 'master', user: user, + name: 'Build pipeline', status: :success, duration: 7210, created_at: 2.hours.ago, started_at: 1.hour.ago, - finished_at: Time.current + finished_at: Time.current, + source: :schedule ) end + let_it_be(:builds) { create_list(:ci_build, 3, :success, pipeline: pipeline, ref: 'master') } + it "graphql/pipelines/pipeline_header_success.json" do query = get_graphql_query_as_string(query_path) @@ -64,6 +69,34 @@ RSpec.describe "GraphQL Pipeline Header", '(JavaScript fixtures)', type: :reques end end + context 'with running pipeline and no permissions' do + let_it_be(:pipeline) do + create( + :ci_pipeline, + project: project, + sha: commit.id, + ref: 'master', + user: user, + status: :running, + created_at: 2.hours.ago, + started_at: 1.hour.ago + ) + end + + let_it_be(:build) { create(:ci_build, :running, pipeline: pipeline, ref: 'master') } + + it "graphql/pipelines/pipeline_header_running_no_permissions.json" do + guest = create(:user) + project.add_guest(guest) + + query = get_graphql_query_as_string(query_path) + + post_graphql(query, current_user: guest, variables: { fullPath: project.full_path, iid: pipeline.iid }) + + expect_graphql_errors_to_be_empty + end + end + context 'with running pipeline and duration' do let_it_be(:pipeline) do create( |