Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
Lukas_Skywalker
5 months ago
|
parent
|
context
|
favorite
| on:
Friendly attributes pattern in Ruby
We can't really tell that without knowing where the code is used, no? It's not hard to imagine a test that checks the following:
bill = FactoryBot.create(:bill, products: []) expect(bill.currency).to eq("USD")
It doesn't cover all possibilities of all currencies, but it doesn't need to. It covers the one case it needs to test.
Consider applying for YC's Summer 2026 batch! Applications are open till May 4
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: