These steps are now part of Spreewald. This note describes a Cucumber step that lets you write this:
Both these approaches will keep your GET parameters -- and will only work for GET requests. Capybara: When /^I reload the...
Cucumber step argument transforms can be a powerful way to make your steps more flexible. Note however that if your...
So this is the simulation that I use in my Agile Testing class, as well as in other contexts where...
RSpec's context (which is basically an alias for describe) takes over your whole application. No object may have its...
With its you can switch the subject of an example to a method value of the current subject: describe Array...
This will not work (it always passes): Then the "Title" field should contain "" The value is turned into a regular...
power-rake db:migrate VERSION=20100913132321 By default the environments development, test, cucumber and performance are considered...
To only run a single describe/context block in a long spec, you can say spec spec/models/note_spec.rb:545 ... where the describe...
You should test the callback methods and its correct invocation in two separate tests. Understand the ActiveRecord note before you...
When submitting textareas, browsers sometimes include carriage returns (\r) instead of just line feeds (\n) at the end of each...
When a spec only runs when it is called directly, but not as part of the whole test suite, make...
By default, Cucumber uses mocha. This note shows to use RSpec stubs and mocks instead. Rspec 1 / Rails 2
This is an awesome gadget in your toolbox, even if your test coverage is great. gem install ruby-debug (Ruby...
Our gem Mail Magnet allows you to override e-mail recipients in ActionMailer so all mails go to a given...
This raises "Could not find first Keyword": describe Keyword do it { should validate_uniqueness_of(:text) } end Do this instead...
def task_with_hoptoad_notification(options) task(options) do begin yield rescue Exception => e Airbrake.notify(e) raise e
Update RubyGems and Passenger Bundler requires Rubygems >= 1.3.6. Run gem update --system if you have an older version.
Sometimes you want to fetch associations for an ActiveRecord that you already loaded, e.g. when it has deeply nested associations...
There are three ways to define your own RSpec matchers, with increasing complexibility and options: 1) Use RSpec::Matchers.define
Boolean attributes can now be set by appending "which", "that" or "who" at the end: Given there is a movie...
When you roll custom URLs with hacks like routing-filter, you can put a spec like this into spec/routing/routing_spec.rb:
Spreewald has steps that let you test that e-mails have been sent, using arbitrary conditions in any combination.
Don't use should validate_format_of(...) because that matcher works in weird ways. Use the allow_value matcher instead...