Creating records in specs can be so fast that two records created instantly after one another might have the same...

This may be hard to find in the docs, but if you want CoffeeScript classes that instantiate their properties from...

This is what worked for me in a Rails 4: # JSON data as first argument, then parameters patch :update, { some...

class Document < ActiveRecord::Base scope :any_tags, -> (tags){ where('tags && ARRAY[?]', tags) } scope :all_tags, -> (tags){ where('tags @> ARRAY...

tl;dr: Use with_index ActiveRecord's find_each with index If you do not provide a block to find...

engineyard.com

Nice tutorial about packaging Ruby bindings to your API in a Ruby gem, with tests using VCR casettes.

api.rubyonrails.org

To avoid n+1 queries, you want to eager-load associated records if you know you need to access them...

Capybara will fail to find tags that are missing an href attribute. This will probably happen to you every now...

When your system is not running on English, you may sometimes want to run some applications and not use your...

Though nowhere to be found in the official docs, this works just fine. describe Facebook::Post do it_behaves_like...

Getting rid of your old LibreOffice Remove your old LibreOffice: sudo apt-get remove libreoffice* You probably also want to...

Let's say you have two screens: Show a given project Show a report for all projects Ideally you want...

Sometimes you need complex expectations on method arguments like this SomeApi.should_receive(:find).with(:query => '*foo*', :sort => 'timestamp ASC', :limit...

makandra dev
github.com

PDFKit converts a web page to a PDF document. It uses a Webkit engine under the hood...

When using jQueryUI's Sortable plugin (either directly or via Angular's ui.sortable), you might struggle testing your nice drag...

Nearly all jQuery traversal functions ignore elements that are not HTML tags. To work with other type of nodes (like...

Microsoft Exchange service administrators can enable Exchange Web Services (EWS) which is a rather accessible XML API for interacting with...

Due to network or hardware failures, it can happen that one of your cronjobs will not run at the time...

TL;DR In blueprints, always wrap associations in blocks. # Broken Task.blueprint(:vacation) do project Project.make(:vacation) hours 8 accounting_method...

In Cucumber, scenario outlines help avoiding tests that are basically the same, except for a few variables (such as different...

stackoverflow.com

Previously the assets group existed to avoid unintended compilation-on-demand in production. As Rails 4 doesn't behave like...

While RSpec 1 and 2 decided that specs inside spec/model are model specs, and those inside spec/features are feature specs...

When you don't only have a favicon.ico in your project but also PNGs of different sizes and backgrounds, you...

makandra dev

Spreewald 1.1.0 drops the be_true and be_false matchers in order to be RSpec 3 and Ruby 2 compatible...