Skip to content

Commit

Permalink
Need to include the middle node so that the sorts can compare properly
Browse files Browse the repository at this point in the history
  • Loading branch information
cheerfulstoic committed Sep 21, 2014
1 parent 43c5f0b commit cb10870
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions spec/integration/label_spec.rb
Expand Up @@ -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
Expand Down

0 comments on commit cb10870

Please sign in to comment.