Chrome’s DevTools are something that I use for a decent portion of my day whenever I’m doing frontend work. I really appreciate how much work has gone into making for a great developer experience, and I’m always stumbing across new tricks to help make me more efficient. Just one of these tricks I picked up this morning from Wes Bos’...
If you are working with a template that has been rendered by a Rails engine (the example I most commonly have is refinery, but any mounted Rails engine behaves the same way), then you will frequently run into a strange problem where route helpers (such as widgets_path, new_whatever_path, etc), result in an undefined method error, which can be quite frustrating...
As a companion to [my post describing how to run tests with docker-compose on Gitlab CI], I converted the build steps this morning to work with Bitbucket Pipelines. Here’s the adapted bitbucket-pipelines.yml file: image: docker:stable pipelines: default: - step: services: - docker script: - apk add --no-cache py-pip bash - pip install --no-cache-dir docker-compose - docker-compose -v - docker-compose run...
I’ve been implementing a style guide this week, and in particular have been trying to focus on creating clean, decoupled, and reusable components. Part of this effort has involved ensuring that all “global” settings that are represented in the style guide are contained in a single settings file. A perfect example of one of these settings is the colour palette....
I’ve been working for some time to get Pawfit (my pet project, literally), continuously deploying. I’ve only recently added tests, so now that I have them, I want a green check each time I push. I run just about all my Rails apps now using Docker and docker-compose, almost always using my own base Docker* files. I choose not to...
I normally work within an RSpec testing envionment, but I definitely enjoy working with more traditional Test::Unit tests when I get the chance. Today I discovered that Minitest, the testing toolkit that has been part of the Ruby standard library since 2.0 has built-in support for mocks and stubs. To use this in a Test::Unit test, simply require "minitest/mocks". Mocking...
I’ve just come across this issue. It’s minor, but it tripped me up! In RSpec, there are three methods I find myself using all the time: before - this is equivalent to the setup method present in many assertion-based test frameworks, and runs before each test. let - this is a lazy-evaluated variable that will be made available to the...
Nested layouts in Rails aren’t a technique that I’ve had to use a lot in the past, but I’m finding myself using them quite a bit in my current work. Nesting layouts allows for some sharing of a common view structure. The best example of this that I have come across is in the app I am working on. This...
My normal Rails 5.x development stack now uses Chrome, running headlessly, powered by the following gems: # Gemfile # ... gem 'capybara' gem 'chromedriver-helper' gem 'capybara-selenium' Unlike using things like Poltergeist, the only external dependency you need to run these tests is Chrome itself. If you wish to reduce your gem dependencies, you can also remove chromedriver-helper, but this will...
The @at-root directive can be quite useful for creating SASS rules where you need to jump outside of a SASS scoping block back to the root level when your styles are compiled. In particular, this directive can be useful for generating BEM styles, since the & abbreviation continues to work for targeting the parent selector. Here’s an example of a...