Checking if a JavaScript value is of a given type can be very confusing: There are two operators typeof and...
RSpec allows you to mark a single Example/ExampleGroup so that only this will be run. This is very useful when...
If you already selected an element and want to get its parent, you can call find(:xpath, '..') on it.
An end-to-end test (E2E test) is a script that remote-controls a web browser with tools like Selenium...
When your public-facing application has a longer downtime for server maintenance or long migrations, it's nice to setup...
Browsers support different types of redirects. Be very careful with these status codes: 301 Moved Permanently 308 Permanent Redirect
When you want to group rails models of a logical context, namespaces are your friend. However, if you have a...
RSpec allows defining methods inside describe/context blocks which will only exist inside them. However, classes (or any constants, for that...
When localizing model attributes via I18n you may run into errors like this: I18n::InvalidPluralizationData: translation data {...
...} can not be...
before(:all) runs the block once before all of the examples. before(:each) runs the block once before each...
You can use local copies of gems in your Gemfile like this: gem 'spreewald', path: '~/gems/spreewald' As soon as you...
I often see the use of || to set a default value for a variable that might be nil, null or...
Nowadays it is fairly easy to intercept and modify mails globally before they are sent. All you have to do...
Rails supports time zones, but there are several pitfalls. Most importantly because Time.now and Time.current are completely different things and...
Database connections are not thread-safe. That's why ActiveRecord uses a separate database connection for each thread.
This card compares patterns to store trees in a relation database like MySQL or PostgreSQL. Implementation examples are for the...
Some pseudo-elements need to be addressed with vendor prefixes. E.g. ::selection is not supported by Firefox, you need to...
There are various ways to run external commands from within Ruby, but the most powerful ones are Open3.capture3 and Open3.popen3...
We generally use multiple application servers (at least two) and you have to search on all of them if you...
First find the reference for the entry you want through looking at the stash: $ git stash list stash@{0}: WIP...
Sometimes huge refactorings or refactoring of core concepts of your application are necessary for being able to meet new requirements...
In general, you should not put a block element inside an inline element. So don't do this: text
This card tries to summarize by example the different uses of heredoc. In Ruby << vs. <<- vs. <<~ In Rails strip_heredoc...
There is no CSS selector for matching elements that contains a given string ¹. Luckily, Capybara offers the :text option to...