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

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

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

github.com

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

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

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

relishapp.com

You can configure RSpec 3.3+ to raise an error when attempting to stub or mock a non-existing method. We...

jasmine.github.io

The easiest way to freeze or travel through time in a Jasmine spec is to use the built-in jasmine.clock...

Running projects parallel makes some trouble with PDF generation. Use geordi rspec spec to force sequential tests for the whole...

relishapp.com

In RSpec you can tag examples or example groups with any tags you like simply by saying describe ReportCreator, slow...

If you want to grow a Ruby Array, you might find out about #fill but it is not really what...

When ending a Selenium test Capybara resets the browser state by closing the tab, clearing cookies, localStorage, etc.

makandra dev

Now supports RSpec 3 and Rails 4 Drops support for state_machine, which has some issues with Rails 4 and...

makandra dev
relishapp.com

RSpec 3 has verifying doubles. This breed of mock objects check that any methods being stubbed are present on an...

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

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

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