You can not use the hash_including argument matcher with a nested hash: describe 'user' do let(:user) { {id: 1...
Rails 5 (don't know about the others) comes with an initializer wrap_parameters.rb. Here you can tell rails to wrap...
Put the line below in the respective env.rb file to make your action controllers raise an ActionController::UnpermittedParameters error when...
select2 is a great jQuery library to make (large) fields more usable. For Bootstrap 3 there is select2-bootstrap-theme...
Capistrano has the concept of a "rollback" that comes in really handy in case of errors. When you notice that...
Rails default config uses the ActiveSupport::Cache::NullStore and disables controller caching for all environments except production: config.action_controller.perform_caching = false...
If you use the Better Errors gem, you will sometimes notice that it can be very slow. This is because...
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...
Nowadays it is fairly easy to intercept and modify mails globally before they are sent. All you have to do...
ChromeDriver clicking works by simulating a mouse click in the middle of the element's first client rect (or bounding...
When you have a multi-server setup, you'll be adding a new server from time to time. Before doing...
Rails supports time zones, but there are several pitfalls. Most importantly because Time.now and Time.current are completely different things and...
This card will show you how to use git rebase --onto without confusion. Use case: You've got two feature...
Webmocks hash_including is similar to RSpec::Mocks::ArgumentMatchers#hash_including. Be aware that hash_including (webmock v3.0.1) doesn't...
Middleman is a static page generator that brings many of the goodies that Rails developers are used to.
Dump this method into your Ruby console to quickly print data in columns. This is helpful for e.g. comparing attributes...
Separate subject from body with a blank line Limit the subject line to 50 characters (max. 72), include reference (unique...
In modern default RSpec configurations, your tests are usually run in random order. This helps to detect "flickering" tests that...
In case you want to require a gem, that is not in the Gemfile of you bundle and therefore not...
Some pseudo-elements need to be addressed with vendor prefixes. E.g. ::selection is not supported by Firefox, you need to...
Sass lets you easily specify multiple selectors at once like this: .some-block &.has-hover, &:hover outline: 1px solid red...
Sometimes you want/have to send specific http(s) requests. You can do that easy with curl or just write the...
Note: The behaviour of Spreewald's within step is as described below for version < 1.9.0; For Spreewald >= 1.9.0 it is...