Skip to content
Snippets Groups Projects
Commit ea75ae2d authored by Mike Burns's avatar Mike Burns Committed by Eugen Rochko
Browse files

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.
parent acb982fc
No related branches found
No related tags found
No related merge requests found
......@@ -16,7 +16,7 @@ RSpec.describe PrecomputeFeedService do
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
it 'does not raise an error even if it could not find any status' do
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment