FactoryBot allows a :class option to its factory definitions, to set the class to construct. However, this option is not...
After loading a staging dump into development, you might get an ActiveRecord::EnvironmentMismatchError when trying to replace the database (like...
When localizing model attributes via I18n you may run into errors like this: I18n::InvalidPluralizationData: translation data {...
...} can not be...
You need to disable "Bluetooth low energy", then follow these core steps: Make sure the headphones are in pairing mode...
Use return to return from a method. return accepts a value that will be the return value of the...
I frequently find myself needing a combination of group_by, count and sort for quick statistics. Here's a method...
before(:all) runs the block once before all of the examples. before(:each) runs the block once before each...
If you want to ssh into your vagrant box without switching into the project directory and typing vagrant ssh, you...
There are many approaches out there how you can import data from a legacy application to a new application. Here...
Scope is all about where something is visible. It’s all about what (variables, constants, methods) is available to you...
You should prefer native promises to jQuery's Deferreds. Native promises are much faster than their jQuery equivalent. Native promises...
Native promises have no methods to inspect their state. You can use the promiseState function below to check whether a...
You can use local copies of gems in your Gemfile like this: gem 'spreewald', path: '~/gems/spreewald' As soon as you...
In the ruby shell (IRB) and rails console the return value of the previous command is saved in _ (underscore). This...
You can not use the hash_including argument matcher with a nested hash: describe 'user' do let(:user) { {id: 1...
When using geordi for integration tests you might get the following error when trying to run geordi cucumber:
You can configure a Ubuntu system as a gateway in order to share it's internet connection (maybe via WLAN...
Capistrano has the concept of a "rollback" that comes in really handy in case of errors. When you notice that...
Webpack is the future. We're using it in our latest Rails applications. For tests, we want to compile assets...
I needed to make sure that an element is visible and not overshadowed by an element that has a higher...
This card will show you a cool way to define a class using Struct.new. A common usecase for Structs are...
Rails default config uses the ActiveSupport::Cache::NullStore and disables controller caching for all environments except production: config.action_controller.perform_caching = false...
Shoulda Matchers don't provide canditional validations (validations with if: option). Here is how to write tests for the condition...
When using GROUP BY, MySQL now complains if the SELECT includes columns which are not part of the GROUP BY...