TL;DR In blueprints, always wrap associations in blocks. # Broken Task.blueprint(:vacation) do project Project.make(:vacation) hours 8 accounting_method...
While RSpec 1 and 2 decided that specs inside spec/model are model specs, and those inside spec/features are feature specs...
When you don't only have a favicon.ico in your project but also PNGs of different sizes and backgrounds, you...
Spreewald 1.1.0 drops the be_true and be_false matchers in order to be RSpec 3 and Ruby 2 compatible...
The attached RSpec matcher allows for comfortably testing delegation. Examples describe Post do it { should delegate(:name).to(:author).with...
So you're getting an error message like the following, although your Gemfile lists shoulda-matchers and it has always...
Using this gem, whenever a Capybara test in Cucumber, Rspec or Minitest fails, the HTML for the failed page and...
RSpec 3.0 deprecates the :should way of writing specs for expecting things to happen. However, if you have tests you...
Warnings like those below may originate from rspec or shoulda-matchers or other gems that have not updated yet to...
When using TextMate2 with the cucumber bundle, it does not recognize step definitions (e.g. custom_steps.rb) as such but believes they...
Sometimes you have a test expectation but actually want a better error message in case of a failure. Here is...
You might not know that Rails disables CSRF protection in tests. This means that if you accidentally forget to send...
If you want to have routes that are only available in tests (e.g. for testing obscure redirects), you can use...
In contrast to RSpec's included allow_value matcher, the attached matcher will also work on associations, which makes it...
When two classes implement the same behavior (methods, callbacks, etc.), you should extract that behavior into a trait or module...
Custom matchers are a useful RSpec feature which you can use to DRY up repetitive expectations in your specs. Unfortunately...
Shared example groups are a useful RSpec feature. Unfortunately the default directory structure generated by rspec-rails has no obvious...
So you're hunting down a regression (or just a bug) and want to use git bisect to find out...
When you need to find out in which kind of spec you are during run-time, it's definitely possible...
Sometimes you need a piece of code to do something different for specs than for features. If you don't...
In specs, the session never persists but is always a new object for each request. Data put into the session...
The User-Agent HTTP header identifies the client and is sent by "regular" browsers, search engine crawlers, or other web...
The way Rational#to_s works on Ruby has changed from Ruby 1.9 on. Here is how to get the...
When a controller action redirects to an external URL (like http://somehost.com/some/path) you will find that this is hard...