Authentication is a special part of web applications. On the one hand, it usually is a crucial security mechanism restrict...
Some browsers render PNG images with color profiles and other shenanigans, some don't. The cleanest way to have consistent...
...It's much easier to detect the current Rails environment instead. You might be better of checking against the name of the current Rails environment. To do this, store the...
This card shows you how to center a float horizontally in CSS. Also: find out what techniques are available for...
Recent IRB versions include a multi-line autocomplete which may be helpful to novice users but can be distracting.
You can not use the hash_including argument matcher with a nested hash: describe 'user' do let(:user) { {id: 1...
When your Cucumber feature needs to browse the page HTML, and you are not sure how to express your query...
Modern CSS offers the field-sizing property to allow elements to automatically adjust size (width and/or height) to fit their...
When using Sidekiq in your application, you must write thread-safe code. This wiki page also lists gems that are...
...lot of logic and callbacks for a particular form screen, but then the model becomes a pain in tests, where all those callbacks just get in the way. Or we...
...have different forms for the same model but they need to behave very differently (e.g. admin user form vs. public sign up form). There are many approaches that promise help...
I frequently find myself needing a combination of group_by, count and sort for quick statistics. Here's a method...
...system's environment specifies. This is usually good enough. To test any timezone-dependent behavior in Chrome, you can change the time zone using the Chrome DevTools Protocol. Example
Creating records in specs can be so fast that two records created instantly after one another might have the same...
These steps are now part of Spreewald. Here are some useful examples how to use the attached Cucumber Timecop steps...
...DateTime.strptime is not what you want You may eventually encounter DateTime.strptime. It's a "better" Time.parse where you can actually define the date format to parse, e.g. >> DateTime.strptime...
...If you use Rails' time_zone_select, you will be juggling zone names like "Berlin" which are actually unsupported. Unsupported zone identifiers are silently discarded and you'll end up...
Ncdu is a disk usage analyzer with an ncurses interface. It is designed to find space hogs on a remote...
Field error steps Spreewald's The...
...field should have an error and The...
...field should have the error...
...steps now...
Git has the concept of hooks: bash scripts that are invoked at certain points in the Git lifecycle. One handy...
If you need to make an HTTPS connection to a host which uses an expired certificate, do not disable certificate...
Using Ruby 1.8.7 you will not be able to use the maximum versions Rubygems 1.8.30 and Bundler 1.17.3 with https://...
...component is using this class to render and modify some html, it may fastly become boilerplate to define every call of the method. Here callFake comes in handy, because it...
...of any dependent on the received arguments without having to know the exact arguments beforehand: spyOn(Random, 'shuffle').and.callFake((array) => array.reverse()) Now you can just assume any result of your...
There seems to be a nasty bug in Chrome 56 when testing with Selenium and Capybara: Slashes are not written...
When using Rails to truncate strings, you may end up with strings that are still too long for their container...
To set a cookie in your test browser for cucumber tests, you need to know which driver you are using...