diff options
Diffstat (limited to 'spec/frontend/fixtures/pipeline_header.rb')
-rw-r--r-- | spec/frontend/fixtures/pipeline_header.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/spec/frontend/fixtures/pipeline_header.rb b/spec/frontend/fixtures/pipeline_header.rb index a4fba7e8675..d25bf12623f 100644 --- a/spec/frontend/fixtures/pipeline_header.rb +++ b/spec/frontend/fixtures/pipeline_header.rb @@ -51,6 +51,8 @@ RSpec.describe "GraphQL Pipeline Header", '(JavaScript fixtures)', type: :reques ) end + let_it_be(:build) { create(:ci_build, :running, pipeline: pipeline, ref: 'master') } + it "graphql/pipelines/pipeline_header_running.json" do query = get_graphql_query_as_string(query_path) @@ -59,4 +61,29 @@ RSpec.describe "GraphQL Pipeline Header", '(JavaScript fixtures)', type: :reques expect_graphql_errors_to_be_empty end end + + context 'with failed pipeline' do + let_it_be(:pipeline) do + create( + :ci_pipeline, + project: project, + sha: commit.id, + ref: 'master', + user: user, + status: :failed, + started_at: 1.hour.ago, + finished_at: Time.current + ) + end + + let_it_be(:build) { create(:ci_build, :canceled, pipeline: pipeline, ref: 'master') } + + it "graphql/pipelines/pipeline_header_failed.json" do + query = get_graphql_query_as_string(query_path) + + post_graphql(query, current_user: user, variables: { fullPath: project.full_path, iid: pipeline.iid }) + + expect_graphql_errors_to_be_empty + end + end end |