Skip to content

Instantly share code, notes, and snippets.

@deepti-kakade
Last active December 18, 2015 15:19
Show Gist options
  • Save deepti-kakade/5803732 to your computer and use it in GitHub Desktop.
Save deepti-kakade/5803732 to your computer and use it in GitHub Desktop.
Rails creates a test folder for you as soon as you create a Rails project using rails new application_name. If you list the contents of this folder then you shall see:
$ ls -F test/
fixtures/ functional/ integration/ test_helper.rb unit/
The unit folder is meant to hold tests for your models
The functional folder is meant to hold tests for your controllers
The integration folder is meant to hold tests that involve any number of controllers interacting. Fixtures are a way of organizing
Test data; they reside in the fixtures folder. T
The test_helper.rb file holds the default configuration for your tests.
Fixture:
Fixtures is a sample data. Fixtures allow you to populate your testing database with predefined data before your tests run. Fixtures are database independent and assume a single format: YAML.
YAML format means
david:
name: David Heinemeier Hansson
birthday: 1979-10-15
profession: Systems development
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment