Today I Learned

3 posts about #testing

Approval Tests are a thing

In normal unit testing, you say expect(person.calculate_bmi).to eq(21) or something like that. Approvals allow you to assert the state of complex objects against a known state.

For example, you can say, Approvals.verify(person)

I had not heard of this approach, which is posed as an alternative to traditional TDD.

Debug Network Activity in Google Chrome

Today I learned about the existence of Google Chrome Net Internals, a utility that gives you extensive abilities related to debugging network activity in your browser. Used it as part of trying to diagnose why some of my Rails project links were hanging in development mode.

Why Capybara requires button for submitting forms

Despite being a super common request, Capybara's API doesn't give you a way to submit forms directly (without hitting a submit button). The denial to do so is actually a principled stance, as you can read for yourself in this pull request. In a nutshell, Jonas believes its a bad practice to do so, plus there is no standard way to support the functionality across all browsers.

Workarounds exist, but seem clunky.