relishapp.com

To only stub a method call if a given argument is used, but use the default implementation for other arguments...

makandra dev
github.com

Geordi 1.0 features a command line application geordi, that holds most of Geordi's previous commands. New features

Add gem 'database_cleaner' to your Gemfile. Then: Cucumber & Rails 3+ # features/support/database_cleaner.rb DatabaseCleaner.clean_with(:deletion) # clean once, now DatabaseCleaner.strategy = :transaction...

When navigating back to a page that was received from a POST request, undesired side effects may happen. Therefore, modern...

stackoverflow.com

Just run git show branch:file. Examples: git show HEAD~:bin/command git show origin/master:../lib/version.rb

ImageMagick takes a string with several options when cropping an image. See the command line options for how to provide...

In the tradition of our PostgreSQL cheat sheet for MySQL lamers, here is a cheat sheet for Jasmine when you...

Here is a Javascript function reloadUsers() that fetches a HTML snippet from the server using AJAX and replaces the current...

When testing code that uses pushState / replaceState, your browser will appear to navigate away from http://localhost:3000/specs (or wherever...

Run bundle update cucumber capybara cucumber-rails to update to the newest versions. Backup your features/support/path.rb to be able to...

Angular 1.3+ has an alternative getter/setter pattern: You can bind ng-model to an accessor function. This is a function...

JavaScript objects can have getter and setter functions that are called when a property is read from or written to...

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

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

developer.mozilla.org

You can do so much more than console.log(...)! See the attached link for a great breakdown of what the developer...

edgeguides.rubyonrails.org

Rails guide that covers PostgreSQL-specific column types and usages for Active Record. You should especially keep in mind the...

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|

makandracards.com

Chances are you're seeing the warning repeated a lot of times, maybe thousands of times. Here's how to...

If you want a class-like construct in JavaScript, you can use the module pattern below. The module pattern gives...

Sometimes you want Angular to watch an object only until a certain state is reached (e.g. an object appears in...