If you want to inspect the compiled code of your erb (or haml) templates, you can run the following code...

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...

nginx.org

If you want to configure your nginx to drop connections to a specific location, you can do so by responding...

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...

makandra dev

In JavaScript we often use Immediately Invoked Function Expessions (or IIFEs) to prevent local variables from bleeding into an outside...

Don't use be_true to check if a value is true. It actually checks if it anything other than...

makandra dev

Geordi is now (partially) tested with Cucumber. Yay! geordi cucumber supports a new @solo tag. Scenarios tagged with @solo...

github.com

Note Maintenance mode is enabled on application server as soon as the file /public/system/maintenance.html is present. Note that the servers...

github.com

A comprehensive script to convert test suites from RSpec 2 to RSpec 3. This converts more than should/expect syntax.

The nokogiri gem provides different packages for several platforms. Each platform-specific variant ships pre-built binaries of libxml2, e.g...

github.com

A collection of 700+ svg vector logos. The logos are optimized (removed duplicated paths / excessive groups / empty defs, linting, etc...

Regular expressions in Javascript are represented by a RegExp object. There also is a regex literal as in many other...

github.com

You know that Devise offers RSpec test helpers for controller specs. However, in request specs, they will not work.

I recommend to go straight to 2.1.5+ without intermediate steps. Otherwhise you burden yourself with unnecessary work of encoding problems...

You can now define this step without Cucumber raising Cucumber::Ambiguous: Then /^I should see "whatever I want"$/ do ...

Cucumber raises a Cucumber::Ambiguous if more than one step definitions match a step. Our new cucumber_priority gem provides...

Simply add this to your .rspec instead: --require spec_helper If you are on rspec >= 3 and use a rails_helper.rb...

From time to time, RubyMine suddenly did not accept any keyboard input and felt crashed, while mouse interaction was still...

When you're developing a gem, never list the same dependency as both runtime and development dependency in your .gemspec...

Sometimes you want to know exactly how many objects exist within your running Ruby process. Here is how: stats = {} ObjectSpace.each...