If you use rails_admin, your specs pass with the rspec binary, but not using rake spec (or rake parallel...
RSpec's be_false behaves unexpectedly: nil.should be_false # passes, as the expectation returns true If you want to check...
All our projects have enum-like requirements like this: An attribute value must be included in a given set of...
This only applies to RSpec below version 1.3.2. The issue has been fixed in RSpec 1.3.2, and most likely RSpec...
When your model is using a callback like before_save or before_validation to calculate an aggregated value from its...
Imagine you have 2 HTML boxes. The first one has a margin-bottom of let's say 30px and the...
You probably know about the possibility to tag scenarios in Cucumber to run your own piece of code before the...
In order to save the original value of a constant, set the new value and restore the old value after...
Ever seen this error when using Graticule? Numerical argument out of domain - acos Similarly to the to_sql problem for...
Possible Reason 1: parallel_tests - running more processes than features If you run old versions of parallel_tests with more...
Views are normally (for good reason) not rendered in controller specs. If you need it to happen, use:
To make the RSpec matcher of the authorization solution Consul work with Rspec 2.x read the following blog post...
When internationalizing your Rails app, you'll be replacing strings like 'Please enter your name' with t('.name_prompt'). You...
RSpec 1 (Rails 2) With the most recent spec_candy.rb helpers you can say: User.stub_any_instance(:foo => :bar) user = User.new...
RSpec lets you define the arguments with which you expect a method to be invoked: subject.should_receive(:say).with('hello...
Never use raise_error without specifying the Error you expect. expect { do_a_lot_of_complicated_stuff }.to raise_error...
Hint: There's another card with this helper for Cucumber features. Sometimes you feel like you need to stub some...
If you're writing a spec for an application using Resque, you may need to work off queues manually without...
This finally works: User.any_instance.should_receive(...) as does User.any_instance.stub(...) Note: You won't have RSpec 2.6 if you're still working...
When you generate a URL in a mailer view, ActionMailer will raise an error unless you previously configured it which...
I've recently encountered a weird problem with specs making lots of SOLR queries using the acts_as_solr plugin...
If you stub a method or set expectations with should_receive these stubbed methods may also yield blocks. This is...
Sometimes, when running a rake task, RubyGems 1.8.5 raises an error: rake aborted! undefined method `specifications' for "/usr/lib/ruby/gems/1.8":String
Consider the following: describe '#something' do context 'with lots of required arguments' do it 'should work' do subject.something(:foo => 'foo...