mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
18 lines
349 B
Ruby
18 lines
349 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
require 'rails_helper'
|
||
|
|
||
|
describe TimelineLookup do
|
||
|
|
||
|
context '.build' do
|
||
|
it 'keeps the last tuple in the lookup' do
|
||
|
tuples = [
|
||
|
[7173, 400], [7174, 390], [7175, 380], [7176, 370], [7177, 1]
|
||
|
]
|
||
|
|
||
|
expect(TimelineLookup.build(tuples, 2)).to eq([[1, 400], [4, 370], [5, 1]])
|
||
|
end
|
||
|
end
|
||
|
|
||
|
end
|