Expecting a primitive value as an argument to a method invocation is easy: expect(object).to receive(:foo).with('arg1...
The NestedHash class allows you to read and write hashes of any depth. Examples: hash = {} NestedHash.write hash, 'a', 'b', 'c...
RSpec provides a nice diff when certain matchers fail. Here is an example where this diff is helpful while comparing...
Don't write resources :people, :concerns => :trashable Write resources :people do concerns :trashable end Why Writing a controller...
Our preferred way of testing ActiveRecord is to simply create/update/destroy the record and then check if the expected behavior has...
RSpec supports a one-liner syntax for setting an expectation on the subject: describe Array do describe "when first created...
Validations should be covered by a model's spec. This card shows how to test an individual validation. This is...
If you expect method calls in RSpec 3, be aware that the argument matchers use very liberal equality rules (more...
Don't use be_true to check if a value is true. It actually checks if it anything other than...
Geordi is now (partially) tested with Cucumber. Yay! geordi cucumber supports a new @solo tag. Scenarios tagged with @solo...
A comprehensive script to convert test suites from RSpec 2 to RSpec 3. This converts more than should/expect syntax.
You know that Devise offers RSpec test helpers for controller specs. However, in request specs, they will not work.
Simply add this to your .rspec instead: --require spec_helper If you are on rspec >= 3 and use a rails_helper.rb...
When you're developing a gem, never list the same dependency as both runtime and development dependency in your .gemspec...
You can configure RSpec 3.3+ to raise an error when attempting to stub or mock a non-existing method. We...
The easiest way to freeze or travel through time in a Jasmine spec is to use the built-in jasmine.clock...
Running projects parallel makes some trouble with PDF generation. Use geordi rspec spec to force sequential tests for the whole...
In RSpec you can tag examples or example groups with any tags you like simply by saying describe ReportCreator, slow...
If you want to grow a Ruby Array, you might find out about #fill but it is not really what...
When ending a Selenium test Capybara resets the browser state by closing the tab, clearing cookies, localStorage, etc.
Now supports RSpec 3 and Rails 4 Drops support for state_machine, which has some issues with Rails 4 and...
RSpec 3 has verifying doubles. This breed of mock objects check that any methods being stubbed are present on an...
To only stub a method call if a given argument is used, but use the default implementation for other arguments...