Rails has always included a scaffold script that generates a default controller implementation for you. Unfortunately that generated controller is...
It is good programming practice to Don't Repeat Yourself (or DRY). In Ruby on Rails we keep our code...
If you need to test interaction with a remote API, check out the VCR gem as an alternative to Webmock...
So you client has asked you to implement a row of buttons to like the URL on Facebook, Twitter and...
If you want to have routes that are only available in tests (e.g. for testing obscure redirects), you can use...
Using text-transform: uppercase - especially on form labels - can cause you serious headaches in Selenium tests. Sometimes the web driver...
We sometimes send calender data or tasks using iCalendar (ICS) via eMail as specified in RFC 5545. Recently, a customer...
In contrast to RSpec's included allow_value matcher, the attached matcher will also work on associations, which makes it...
The translation method translate and its alias t have bang brothers: translate! and t!. They will raise I18n::MissingTranslationData on...
When two classes implement the same behavior (methods, callbacks, etc.), you should extract that behavior into a trait or module...
Simply give the select helper an option :disabled, passing either a single value or an array. You need to specify...
So you're hunting down a regression (or just a bug) and want to use git bisect to find out...
Consul 0.9 comes with many new features to optimize powers that only check access to a given record. e.g. Power.current.post...
Similar to closing an opened browser window, spreewald now supports the I switch to the new browser tab step.
1. Saving files to a directory that is not shared between deploys or servers If you save your uploads to...
Capybara drivers will usually delete all cookies after each scenario. If you need to lose cookie data in the middle...
When your site is on HTTPS and you are linking or redirecting to a HTTP site, the browser will not...
In the following example the method update_offices_people_count won't be called when office_id changes, because it...
Rails gives you migrations to change your database schema with simple commands like add_column or update. Unfortunately these commands...
In specs, the session never persists but is always a new object for each request. Data put into the session...
Note: This technique is confusing and slows down your test suite. Copy the attached code to features/support. This gets you...
The User-Agent HTTP header identifies the client and is sent by "regular" browsers, search engine crawlers, or other web...
When a controller action redirects to an external URL (like http://somehost.com/some/path) you will find that this is hard...
Unfortunately, Capybara does not offer a switch to disable cookies in your test browser. However, you can work around that...