Test Driven Development (TDD) – Part 2 – Integration Testing

Now that your RSpec environment is all set up, it’s time to start writing some actual tests.  Let’s start with integrations tests, which tests how different components (models, controllers etc.) interact with one another. Create the Integration Folder To start, make future you and any team members really happy by creating an integration folder, within...
Read More

Recursion

A method that calls itself. The only time I ever saw something calling itself was outside of my wonderful apartment in the delightfully urine soaked street underneath a blanket. I could not for the life of me grasp how it worked. Yeah, I got the metaphors. “It’s kind of like Inception. You can’t wake out...
Read More

Model validations in Rails

Validations are pretty much a “check” that records won’t be saved unless certain attributes/params meet a specified criteria. They can all done in the models and they can be done in a single line per attribute. For example, if we have a Painting model, inside the class(model) we have: validates :name, presence: true, uniqueness: true...
Read More