Write declarative tests using nested contexts without performance penalties. Contest is less than 100 lines of code and gets the job done...
Riot differs primarily in that it does not rerun setup for each test in a context...
Unlock achievements for running your test suite...
ShamRack mounts a Rack app locally, just for your tests. It goes one further: it “mounts” it using Net::HTTP such that requests to the Rack app never hit any...
The Holy Grail of testing for front-end development; execute browser-less, console-based, javascript + DOM code right from within your Rails test suite...
Always use simply require 'spec_helper' If you mix it up like require 'spec_helper' require File.dirname(__FILE__) + '/../spec_helper'
If your Ruby project includes a gem like Spreewald that comes with some external step definition, RubyMine does not know...
This raises "Could not find first Keyword": describe Keyword do it { should validate_uniqueness_of(:text) } end Do this instead...
Put the attached file into features/support/. Example usage: When /^I open the task named "(.+?)"$/ do |task_name| task = page.all('.task...
The Rails secret_token must be unique for each application and any instance of it. If not, someone could exploit...
If you want to exclude your staging site from Google using robots.txt without running the risk to forget deleting the...
...to a given address. This is useful for staging environments where you want to test production-like mail delivery without sending e-mails to real users...
...showing how to set a fixed random seed and clear Faker::UniqueGenerator before each test
Best results in other decks
Automated tests are how we keep a low defect rate without a QA department. This lesson covers why we test, the difference between unit and end-to-end tests, and...
...details, no chasing coverage 📄 Pyramid or Crab? Find a testing strategy that fits — the different test-suite shapes side by side 📄 Guidelines for Testing Rails Applications — the same discussion for...
Every test needs data. Instead of Rails' global fixtures we use factories that create only the records a test needs, which keeps tests isolated and predictable. Important
...lesson in teacher mode. Learning goals You can explain why we create test data with factories instead of fixtures: each test starts empty and creates only what it needs.