diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2017-03-07 11:48:01 +0100 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2017-03-07 11:51:09 +0100 |
commit | a15fe2a1ac3f45556220b5fb4a22ea3c1aa0c5a3 (patch) | |
tree | 680fc72665d7f9a41dc46dd227297bcfb1d6290e /spec/views/projects/pipelines/_stage.html.haml_spec.rb | |
parent | 0cc4afc96607b7f3b751ff7ca42c24a0b8499dbe (diff) | |
download | gitlab-ce-sort-builds-in-stage.tar.gz |
Sort builds in stage dropdownsort-builds-in-stage
Order: failed pending running manual canceled success skipped created
Diffstat (limited to 'spec/views/projects/pipelines/_stage.html.haml_spec.rb')
-rw-r--r-- | spec/views/projects/pipelines/_stage.html.haml_spec.rb | 19 |
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..b168630907a 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 |