Commit a7b3f452 authored by ddavison's avatar ddavison

Provide has aliases for completed jobs/pipelines

parent 8127a62d
...@@ -13,6 +13,10 @@ module QA ...@@ -13,6 +13,10 @@ module QA
timeout ? completed?(timeout: timeout) : completed? timeout ? completed?(timeout: timeout) : completed?
status_badge == status status_badge == status
end end
# has_passed? => passed?
# has_failed? => failed?
alias_method :"has_#{status}?", :"#{status}?"
end end
# e.g. def pending?; status_badge == 'pending'; end # e.g. def pending?; status_badge == 'pending'; end
......
...@@ -32,7 +32,7 @@ module QA ...@@ -32,7 +32,7 @@ module QA
parent_pipeline.click_linked_job(project.name) parent_pipeline.click_linked_job(project.name)
expect(parent_pipeline).to have_job("child_job") expect(parent_pipeline).to have_job("child_job")
expect(parent_pipeline).to be_passed expect(parent_pipeline).to have_passed
end end
end end
...@@ -44,7 +44,7 @@ module QA ...@@ -44,7 +44,7 @@ module QA
parent_pipeline.click_linked_job(project.name) parent_pipeline.click_linked_job(project.name)
expect(parent_pipeline).to have_job("child_job") expect(parent_pipeline).to have_job("child_job")
expect(parent_pipeline).to be_failed expect(parent_pipeline).to have_failed
end end
end end
......
...@@ -32,7 +32,7 @@ module QA ...@@ -32,7 +32,7 @@ module QA
parent_pipeline.click_linked_job(project.name) parent_pipeline.click_linked_job(project.name)
expect(parent_pipeline).to have_job("child_job") expect(parent_pipeline).to have_job("child_job")
expect(parent_pipeline).to be_passed expect(parent_pipeline).to have_passed
end end
end end
...@@ -44,7 +44,7 @@ module QA ...@@ -44,7 +44,7 @@ module QA
parent_pipeline.click_linked_job(project.name) parent_pipeline.click_linked_job(project.name)
expect(parent_pipeline).to have_job("child_job") expect(parent_pipeline).to have_job("child_job")
expect(parent_pipeline).to be_passed expect(parent_pipeline).to have_passed
end end
end end
......
...@@ -85,7 +85,7 @@ module QA ...@@ -85,7 +85,7 @@ module QA
end end
Page::Project::Pipeline::Show.perform do |show| Page::Project::Pipeline::Show.perform do |show|
expect(show).to be_passed expect(show).to have_passed
expect(show).to have_no_job("downstream_job") expect(show).to have_no_job("downstream_job")
show.click_linked_job(downstream_project_name) show.click_linked_job(downstream_project_name)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment