We often use the Then console step from spreewald in combination with geordi vnc from geordi to debug tests within...

makandracards.com

In Spreewald 1.10.4+, nested patiently blocks are now patient. Here is an example: patiently do outer_code patiently do

Use bundler > 1.15 to fix Gem::LOADED_SPECS_MUTEX (NameError). Given the following project: ruby -v ruby 1.8.7

w3c.github.io

Here is how to use Chromedriver without libraries like selenium-webdriver. This can be useful for debugging. The following example...

web.archive.org

When flagging a spec that will be implemented later as pending, include a failing spec body or RSpec 3 will...

makandra dev

When a Rails controller action should handle both HTML and JSON responses, do not use request.xhr? to decide that. Use...

I recently had fun with replacing a custom video plattform ("mycustomtv") in one of our applications. I learned a lot...

makandra dev
github.com

Generating a project README Finally: Support for modelling associations between models in your application model! Example: # lib/katapult/application_model.rb

Understanding your type of cronjob Some cronjobs must only run on a single server. E.g. when you run nightly batch...

When you have a pending Cucumber step (or feature) that also uses an existing VCR cassette, your pending test may...

makandra dev
github.com

Katapult 0.3.0 brings Rails 5 and Ruby 2.5 support with a new design, plus a ton of smaller features, fixes...

Enumerable#all? returns true for an empty collection. This totally makes sense but you have to think about it when...

This cucumber step is useful for testing an image (looking at the src of the image). Then(/^I should see...

makandra dev

ActiveSupport::Dependencies takes care of auto-loading any classes in development. This is usually useful, but when you run into...

TL;DR Use user.update!(remove_avatar: true) to delete attachments outside of forms. This will have the same behavior as...

To check which elements an ActiveRecord relation contains use the contain_exactly matcher. describe User do let!(:admin) { create(:user...

This is a small example on how you can check if your Postgres index can be used by a specific...

github.com

The issue: You are using stub_const to change a constant value for your test. stub_const "SomeClass::CONST", 'test...

blog.bigbinary.com

This error is raised because your old database does not have a configured environment yet, which Rails 5 enforces.

makandra dev
makandracards.com

Rails applications and ruby gems should have a README that gives the reader a quick overview of the project. Its...

makandra dev
curl.haxx.se

When making requests using curl, no cookies are sent or stored by default. However, you can tell curl to re...

You should avoid using application models in your migrations. But how else could you create records in a migration?

web.archive.org

wrap the text with a span use line-height for the spacing between lines ("margin")

Situation: You want to write a spec for a function inside an Angular service. This function at some point makes...