When an event listener on a DOM element throws an error, that error will be silenced and not interrupt your...

Running Cucumber tests while your cucumber.yml is 100% valid may still produce the following error. cucumber.yml was found, but could...

tl;dr Don't forget require 'English' if you use a named global such as $LAST_MATCH_INFO. Otherwise this...

betterspecs.org

betterspecs.org is a documentation on how to write better RSpec tests. Note that there are also other approaches like The...

makandra dev

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...

makandra dev
thoughtbot.com

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...

To make CSS rules dependent on the screen size, we use media queries: @media (max-width: 500px) { // rules for screen...

github.com

The linked GitHub repository is a bit like our "dev" cards deck, but groomed from a single person (Josh Branchaud...

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...

Turns out, Cucumber::MultilineArgument::DataTable#diff! caches some stuff. Code of the following form will not work as intended:

Embedding videos on a website is very easy, add a tag to your source code and it just works...

To find an input with the type hidden, you need to specify the type hidden: find_field('Some label', type...

makandra dev

If you need to test some HTML, e.g. an embed code, you can use RubyMine's "scratch files":

makandra dev

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...

This is a personal post-mortem analysis of a project that was mainly build to provide a REST API to...

PostgreSQL and ActiveRecord have a good support for storing dynamic attributes (hashes) in columns of type JSONB. But sometimes you...

Sometimes, you might have duplicate links on a page. Trying to click those links will by default cause Capybara to...

medium.com

Root Insurance runs their application as a monolithic Rails application – but they've modularized it inside its repository. Here is...

When you have two inputs, where one contains the name of the other (eg. Name and Name with special treatment...