mirror of
https://github.com/mastodon/mastodon.git
synced 2024-12-18 00:54:49 +01:00
Use be_within instead of eq for a to_f test match (#6275)
Floating point values are notoriously hard to pin down, so use the `be_within` matcher to verify the approximate value.
This commit is contained in:
parent
acb982fc66
commit
ea75ae2d1f
@ -16,7 +16,7 @@ RSpec.describe PrecomputeFeedService do
|
|||||||
|
|
||||||
subject.call(account)
|
subject.call(account)
|
||||||
|
|
||||||
expect(Redis.current.zscore(FeedManager.instance.key(:home, account.id), reblog.id)).to eq status.id.to_f
|
expect(Redis.current.zscore(FeedManager.instance.key(:home, account.id), reblog.id)).to be_within(0.1).of(status.id.to_f)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'does not raise an error even if it could not find any status' do
|
it 'does not raise an error even if it could not find any status' do
|
||||||
|
Loading…
Reference in New Issue
Block a user