diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 14:18:50 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 14:18:50 +0300 |
commit | 8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781 (patch) | |
tree | a77e7fe7a93de11213032ed4ab1f33a3db51b738 /spec/lib/milestone_array_spec.rb | |
parent | 00b35af3db1abfe813a778f643dad221aad51fca (diff) |
Add latest changes from gitlab-org/gitlab@13-1-stable-ee
Diffstat (limited to 'spec/lib/milestone_array_spec.rb')
-rw-r--r-- | spec/lib/milestone_array_spec.rb | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/spec/lib/milestone_array_spec.rb b/spec/lib/milestone_array_spec.rb deleted file mode 100644 index 375cb87dde6..00000000000 --- a/spec/lib/milestone_array_spec.rb +++ /dev/null @@ -1,36 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -describe MilestoneArray do - let(:object1) { instance_double("BirdMilestone", due_date: Time.now, start_date: Time.now - 15.days, title: 'v2.0') } - let(:object2) { instance_double("CatMilestone", due_date: Time.now - 1.day, start_date: nil, title: 'v1.0') } - let(:object3) { instance_double("DogMilestone", due_date: nil, start_date: Time.now - 30.days, title: 'v3.0') } - let(:array) { [object1, object3, object2] } - - describe '#sort' do - it 'reorders array with due date in ascending order with nulls last' do - expect(described_class.sort(array, 'due_date_asc')).to eq([object2, object1, object3]) - end - - it 'reorders array with due date in desc order with nulls last' do - expect(described_class.sort(array, 'due_date_desc')).to eq([object1, object2, object3]) - end - - it 'reorders array with start date in ascending order with nulls last' do - expect(described_class.sort(array, 'start_date_asc')).to eq([object3, object1, object2]) - end - - it 'reorders array with start date in descending order with nulls last' do - expect(described_class.sort(array, 'start_date_desc')).to eq([object1, object3, object2]) - end - - it 'reorders array with title in ascending order' do - expect(described_class.sort(array, 'name_asc')).to eq([object2, object1, object3]) - end - - it 'reorders array with title in descending order' do - expect(described_class.sort(array, 'name_desc')).to eq([object3, object1, object2]) - end - end -end |