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...
Because your examples should not change global state, you should not need to care about the order in which RSpec...
I encountered a bug in RSpec 1.x where stubbed class methods ("static methods") would not be unstubbed before the...
geordi, our collection of awesome shell scripts, has been extended by three scripts to help you call RSpec or Cucumber...
When using the resource_controller gem you often hook onto events like this: update.before do do_something end
When your cucumber features grow massively over time, the test execution can take a lot of time.
Run rspec-and-cucumber from any project directory to run both RSpec and Cucumber. If available, rspec_spinner or cucumber...
The Basic Authentication header encodes username and password. Effectively, it's just Base64 plus a "Basic" prefix.
Bryan talked about the differences between imperative and declarative scenarios. In my opinion, both styles have benefits and should be...
When you write a custom RSpec matcher a good place to store them is to create one file per matcher...
To test whether a hash includes an expected sub-hash: expect(user.attributes).to match(hash_including('name' => 'Bruce Wayne'))
Back when Steak was first released, Capybara didn’t have any of the nice RSpec helpers it does now. A...
Note that you cannot currently use Ruby 1.9.2 with Rails 2 applications that use RSpec, so don't upgrade if...
If in your application your users pass along params that result in filenames, like invoices/generated?number=123. This could be...
The attached RSpec matcher exist_in_database checks if a given record still exists in the database and has not...
We are maintaining some vintage projects with tests written in Test::Unit instead of RSpec. Mocks and stubs are not...
track down warnings and to see failing specs immediately or to get an overview of the core...
So you are comparing two Time objects in an RSpec example, and they are not equal, although they look equal...
If you want to get a deep understanding of how closures, blocks, procs & lambdas in Ruby work, check out the...