summaryrefslogtreecommitdiff
path: root/spec/views
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2017-03-07 11:48:01 +0100
committerKamil Trzcinski <ayufan@ayufan.eu>2017-03-07 12:46:53 +0100
commitb817ce2d7e6b46fa924838674875b381486344b8 (patch)
tree9be7b8bf3dd4d50a56105ae1b52e7d8a2cbf386e /spec/views
parentdb2617fd5f690282a7e844a361eac9da6aeea8c7 (diff)
downloadgitlab-ce-b817ce2d7e6b46fa924838674875b381486344b8.tar.gz
Sort builds in stage dropdown
Order: failed pending running manual canceled success skipped created
Diffstat (limited to 'spec/views')
-rw-r--r--spec/views/projects/pipelines/_stage.html.haml_spec.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/views/projects/pipelines/_stage.html.haml_spec.rb b/spec/views/projects/pipelines/_stage.html.haml_spec.rb
index d25de8af5d2..65f9d0125e6 100644
--- a/spec/views/projects/pipelines/_stage.html.haml_spec.rb
+++ b/spec/views/projects/pipelines/_stage.html.haml_spec.rb
@@ -50,4 +50,23 @@ describe 'projects/pipelines/_stage', :view do
expect(rendered).to have_text 'test:build', count: 1
end
end
+
+ context 'when there are multiple builds' do
+ before do
+ HasStatus::AVAILABLE_STATUSES.each do |status|
+ create_build(status)
+ end
+ end
+
+ it 'shows them in order' do
+ render
+
+ expect(rendered).to have_text(HasStatus::ORDERED_STATUSES.join(" "))
+ end
+
+ def create_build(status)
+ create(:ci_build, name: status, status: status,
+ pipeline: pipeline, stage: stage.name)
+ end
+ end
end