Ruby has this handy block shortcut map(&:to_i) for map { |x| x.to_i }. However, it is limited to argument...
The method cookies is defined in the ActionController and should never be overwritten. Bad example class StaticPagesController < ApplicationController
When you need to store structured data (like Ruby hashes) in a single database column with ActiveRecord, a simple way...
RSpec let's you chain a matcher with .or. The expectation will then pass if at least one matcher matches...
There is a kinda secret, yet well supported CSS feature called currentColor. It's like a special CSS variable that...
A matcher is a function that returns an object with a compare key. Usually it is registered with beforeEach...
TL;DR Append your locale keys with _html to have them marked as html_safe and translate them with = t...
Using the JS fullscreen API is painful because all browers use different methods and events and you need to use...
You know that you can use jQuery's text() to get an element's contents without any tags.
If your rails application is unable to send mails, it might be useful to debug your settings using the rails...
When you have a large PG database, you may want to find out which tables are consuming the most disk...
Webpacker uses Babel and Webpack to transpile modern JavaScript down to EcmaScript 5. Depending on what browser a project needs...
CarrierWave comes with some RSpec matchers which will make testing more comfortable. Let's say you have an Uploader like...
Recent Bundler (1.16.1) started complaining about missing dependencies in the Gemfile. This is due to a stricter handling of specifications...
When you need test images, instead of using services like lorempixel or placehold.it you may generate test images yourself.
If the argument list is the same every time: expect(object).to receive(:foo).with('argument').and_return('response 1...
You might have some trouble running a Rails LTS 2 app with MySQL 5.7. If you don't want to...
MySQL and MariaDB have an SQL mode setting which changes how MySQL behaves. The SQL mode value is comprised of...
Rails offers a way to prepend (or append) view paths for the current request. This way, you can make the...
We often use the Then console step from spreewald in combination with geordi vnc from geordi to debug tests within...
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
Here is how to use Chromedriver without libraries like selenium-webdriver. This can be useful for debugging. The following example...
When flagging a spec that will be implemented later as pending, include a failing spec body or RSpec 3 will...