Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feed version ordering #1217

Merged
merged 3 commits into from
Jan 12, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions spec/models/feed_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,17 @@
})
end

context '.feed_versions' do
it 'orders by earliest_calendar_date' do
feed = create(:feed)
fv1 = create(:feed_version, feed: feed, earliest_calendar_date: '2015-01-01')
fv2 = create(:feed_version, feed: feed, earliest_calendar_date: '2016-01-01')
fv3 = create(:feed_version, feed: feed, earliest_calendar_date: '2017-01-01')
feed.reload
expect(feed.feed_versions).to match_array([fv3, fv2, fv1])
end
end

context 'import status' do
it 'handles never imported' do
feed = create(:feed)
Expand Down