Concatenating multi-line strings in ruby

I enjoy ThoughtBot's TIL (today I learned) and I'm doing some of the same when I come across something I haven't before.

Today's item that I learned was that you can concatenate strings in ruby with the backslash '' at the end of the line.

Read More..

FactoryGirl - Overriding a parent association

I've been working a lot in RSpec and with FactoryGirl recently and came across a need to change the way a factory worked. This is in existing code and I didn't want to go through the whole codebase and see where the factory was defined and do things differently. I wanted to override the existing behavior for just one test that I needed to run.

Read More..

git worktree

Over the past couple of months I've had to work on a number of projects at the same time for a couple of clients. Git worktree, which was introduced in Git 2.5 has been a lifesaver for me.

I often have a development branch that I'm working on and...

Read More..

Turnip and DatabaseCleaner

I've been working on some Turnip BDD scenarios for an existing site and just getting through the login process has been "interesting".

In general, I've just been working through the flow and when I come across some data that I need I either create a factory_girl object, or make a mock/double of a method. This was the case when I had to have some country data in the application. I dutifully created a factory and got everything set up. Binding.pry come to my rescue when I was still having problems. Imagine my surprise when my data wasn't there.

Read More..

Docker, Rspec and Guard

Docker has been a blessing for development, especially when I want to maintain a consistent environment for each client, I want to be able to back up those environments easily, and transport them to wherever I want to.

Read More..