With Rspec you can mock objects or functions, for example like this: expect(my_object).to receive(:my_function).and...
We use the whenever gem to automatically update the crontab of the servers we deploy to. By default, whenever will...
One of the earliest pieces of wisdom we are given as programmers is to not write duplicate code: Don’t...
This seems to be obvious, but you can expect Rake tasks to be called in RSpec. it 'deletes all Users...
Using git fixup helps you to speed up appending changes further back in the git history of your feature branch...
To make CSS rules dependent on the screen size, we use media queries: @media (max-width: 500px) { // rules for screen...
You can install rubygems 3.0.8 (released on February 18, 2020) to keep all the Gem::Specification#rubyforge_project deprecation warnings...
When you have many changes, and you want to spread them across different commits, here is a way to stage...
The linked GitHub repository is a bit like our "dev" cards deck, but groomed from a single person (Josh Branchaud...
In Active Record you can use named bindings in where-conditions. This helps you to make your code more readable...
With puma you can have concurrent requests. There are two concepts on how Puma can handle two incoming requests: Workers...
Test-Driven Development (TDD) in its most dogmatic form (red-green-refactor in micro-iterations) can be tedious. It does...
Simplecov is a code coverage tool. This helps you to find out which parts of your application are not tested...
A recent patch level Ruby update caused troubles to some of us as applications started to complain about incompatible gem...
Chrome allows you to throttle the Network and the CPU. Both settings are useful to measure the performance of you...
Embedding videos on a website is very easy, add a tag to your source code and it just works...
Code comments allow for adding human readable text right next to the code: notes for other developers, and for your...
To find an input with the type hidden, you need to specify the type hidden: find_field('Some label', type...
If you need to test some HTML, e.g. an embed code, you can use RubyMine's "scratch files":
We can use ActiveRecord's where to add conditions to a relation. But sometimes our condition is not on the...
You can use the CSS property mask-image to define an "alpha channel" for an element. E.g. to let an...
TLS/SSL certificates are often used for HTTPS traffic. Occasionally a service may also use their TLS certificate to support public...
Or: How to avoid and refactor spaghetti code Please note that I tried to keep the examples small. The effects...
Imagine you want to write a cucumber test for a user-to-user chat. To do this, you need the...