rspec
16 posts · All topics
- — How To Test Delayed Jobs
There are two ways to test delayed jobs under RSpec.
- — Custom RSpec Meta Tag Validator
I’ve written my share of RSpec tests that look for specific meta tags in a web page under Capybara. It would be nice to be able to spell the following.
- — Precompiling Rails Assets before RSpec/Capybara Integration Tests
The first Capybara integration test always tends to timeout when compiling assets on-demand. It’s just damn too slow. Precompile your assets before the test is run.
- — Should you use 'Should' in RSpec Examples?
There are two kinds of developers: those who use should in RSpec examples and those who use present tense.
- — How do I get the name of an object's type in JavaScript?
I love reflection, especially the Ruby kind. JavaScript reflection, though, can exhibit interesting runtime behavior.
- — RSpec-Rerun Gem
I just published a new gem: rspec-rerun. It’s a packaged solution to rerunning failed RSpec tests. See README for details.
- — Grape API Mounted on RACK w/ Static Pages, Tests, JQuery UI, Backbone.js and Even Mongo
Expanding from my previous post on a Grape API mounted on RACK.
- — Don't Hate UI Testing - Reliably Testing Asynchronous UI w/ RSpec & Capybara
- — Testing w/ Analytical Gem and RSpec
We use the Analytical gem to include various thirdparty Javascript in our Rails application. Our test environment was configured with dummy values in config/analytical.yml.
- — Warning: Toplevel Constant XYZ Referenced Admin:XYZ
I posted this to a Ruby forum a while ago.
- — Fabricating Spec Failures
I love fabricators. We use the awesome fabrication gem that lets you do some pretty neat things in Rails specs.
- — Permission denied - /var/tmp/ruby-uuid
I’ve been fighting a trivial RoR controller test failure on a new build machine. The spec is rather trivial.
- — RSpec: Fuubar + Breaking Tests into Suites
Inspired by this post on RSpec best practices and updated for RSpec2.
- — RSpec + Capybara Don't Return a Proper Exit Code
We’ve been trying to fix an issue with our continuous integration where Capybara tests were failing, but the CI process reported success. Rather annoying for CI!
- — Grape: trapping all exceptions within the API
We’ve been using Grape to provide a RESTful API. Grape is a micro-framework for Ruby that makes it really easy.
- — kernel.rb:27:in `should': uninitialized constant RSpec::Expectations::PositiveExpectationHandler (NameError)
This one took a while and required extensive help from a rocket scientist. While running RSpec I got this.
