From cb10870e826b4c571eae2e439f9f2eeb0add972e Mon Sep 17 00:00:00 2001 From: Brian Underwood Date: Sun, 21 Sep 2014 10:19:18 +0200 Subject: [PATCH] Need to include the middle node so that the sorts can compare properly --- spec/integration/label_spec.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/integration/label_spec.rb b/spec/integration/label_spec.rb index a313e8b33..84116a2f8 100644 --- a/spec/integration/label_spec.rb +++ b/spec/integration/label_spec.rb @@ -172,19 +172,19 @@ class EmptyTestClass end @jasmine = FirstLastTestClass.create(name: 'jasmine') - FirstLastTestClass.create + @middle = FirstLastTestClass.create @lauren = FirstLastTestClass.create(name: 'lauren') end describe 'first' do it 'returns the first object created... sort of, see docs' do - expect(FirstLastTestClass.first).to eq [@jasmine, @lauren].sort_by(&:uuid).first + expect(FirstLastTestClass.first).to eq [@jasmine, @middle, @lauren].sort_by(&:uuid).first end end describe 'last' do it 'returns the last object created... sort of, see docs' do - expect(FirstLastTestClass.last).to eq [@jasmine, @lauren].sort_by(&:uuid).last + expect(FirstLastTestClass.last).to eq [@jasmine, @middle, @lauren].sort_by(&:uuid).last end it 'returns nil when there are no results' do