There are three ways to define your own RSpec matchers, with increasing complexibility and options: 1) Use RSpec::Matchers.define
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...
You can write regular expressions some different ways, e.g. /regex/ and %r{regex}. For examples, look here. Remember that it...
The following example is from the Cucumber wiki: Given a blog post named "Random" with Markdown body """ Some Title, Eh...
Our awesome collection of rspec helpers (formerly known as "spec_candy.rb") is now available as a gem. It works, it is...
An alternative to this technique is using VCR. VCR allows you to record and replay real HTTP responses, saving you...
This will tunnel HTTP requests to one given domain and port through an intermediary SSH server: ssh -L 8080:targethost...
For example, to send a form and populate a preview div with the response. $('content_form').request({ parameters: { 'preview': "1...
When a Cucumber feature leaves your page through an external Link, Webrat has problems like "Could not find field: "E...
This may be awkward to set up, but will work once you're done. Fun facts:
Most of these will not work in newer projects because these use the Capybara/Rack::Test combo in lieu of Webrat...
With defaults, RCov doesn't work the way you how you would like it to. To create a nice test...
To test concurrent code, you will need to run multiple threads. Unfortunately, when you use blocking system calls (e.g. locks...
rspec_spinner is a progress bar for RSpec which outputs failing examples as they happen (instead of all at the...
Install gem and plugin sudo gem install parallel script/plugin install git://github.com/grosser/parallel_tests.git Adapt config/database.yml test: database: xxx_test<%= ENV...
sudo gem install gettext --no-ri --no-rdoc sudo gem install fast_gettext --no-ri --no-rdoc script/plugin install git://...
When you need to patch an existing gem, one way is to "vendor" the gem by copying it into the...
This note shows how to merge an ugly feature branch with multiple dirty WIP commits back into the master as...
To run a single test file: rake test:units TEST=test/unit/post_test.rb rake test:functionals TEST=test/functional/posts_controller_test.rb rake test:integration TEST...
Basic configuration Please keep this config simple. It should be a starting point for new developers learning Git. [user]
This is for people recovering from Subversion. Get an existing from the server for the first time git clone git@example.com...
jqueryElement.is(':checked')