github.com

Capybara-screenshot can automatically save screenshots and the HTML for failed Capybara tests in Cucumber, RSpec or Minitest. Requires Capybara...

makandra dev
api.rubyonrails.org

Rails includes a way to see what an e-mail will look like. Integration to RSpec All you need to...

capybara_element['attribute_name'] allows accessing an element's attributes in Capybara. A few examples: find('#my_element')['class']

Cucumber will clean up files you've uploaded in your Cucumber features automatically with the attached code. Put the file...

makandra dev

RSpec::Matchers.define :be_naturally_sorted do match do |array| array == array.natural_sort end end See RSpec: Where to put custom...

This step will pass if the specified select is sorted. Then /^the "(.*?)" select should be sorted$/ do |label, negate|

Option 0: Download from the official page (preferred) Open https://googlechromelabs.github.io/chrome-for-testing/ In Section "Stable" > chromedriver / linux64 > Download ZIP from...

tutorialzine.com

A very clever hack to parse a structured URL object is to create a element and set its href to...

Upgrading from Ruby 1.8.7 to 2.1.2 took me an hour for a medium-sized application. It involved hardly any changes...

makandra dev

Cucumber allows for prose in features and scenarios. Example: Feature: Cancel account There are several ways to cancel a user...

makandracards.com

This is a problem when using Selenium with Firefox. We recommend using ChromeDriver for your Selenium tests. Firefox will not...

github.com

Using this gem I could get JSON generation from a large, nested Ruby hash down from 200ms to 2ms.

Firefox 5.0.1, which we were using for most Rails 2.3 projects, does not run on Ubuntu 14.04 any more. Here...

Just install the texlive-xetex package: sudo apt-get install texlive-xetex Running integration tests without texlive-xetex will produce...

engineyard.com

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

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

# config/initializers/sidekiq.rb # Perform Sidekiq jobs immediately in development, # so you don't have to run a separate process.

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

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

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

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