thoughtbot--shoulda-matchers/test
Nick Quaranto 4c95b08450 Merge commit 'dstrelau/1.9' into ruby19 2009-06-16 21:16:20 -04:00
..
fixtures Fixed should_have_many regression [#60] 2008-08-31 12:14:16 -04:00
functional Fixed set_session not matching false values. [#174 state:resolved] 2009-05-07 20:43:47 -07:00
matchers Changed the behavior of AllowValue matcher so that should_allow_values_for fails if there is ANY error on the specified attribute 2009-06-09 20:09:08 -04:00
other Merge commit 'dstrelau/1.9' into ruby19 2009-06-16 21:16:20 -04:00
rails_root Merge commit 'dstrelau/1.9' into ruby19 2009-06-16 21:16:20 -04:00
unit Changed the behavior of AllowValue matcher so that should_allow_values_for fails if there is ANY error on the specified attribute 2009-06-09 20:09:08 -04:00
README When in a rails environment, only load shoulda when RAILS_ENV equals 'test' [#134] 2009-01-19 11:29:54 -05:00
fail_macros.rb When searching for test failure, accept either MiniTest::Assertion or Test::Unit::AssertionFailedError for Ruby 1.9 compatibility. 2009-06-02 22:41:17 -04:00
model_builder.rb Switched to ActiveSupport::TestCase for Rails 2.3 support 2009-05-05 18:39:22 -07:00
rspec_test.rb Switched to ActiveSupport::TestCase for Rails 2.3 support 2009-05-05 18:39:22 -07:00
test_helper.rb Switched to ActiveSupport::TestCase for Rails 2.3 support 2009-05-05 18:39:22 -07:00

README

The Shoulda test suite (in particular - the tests that test shoulda)

Quick overview:

The test directory contains the following files and subdirectories:

* rails_root - contains the stripped down rails application that the tests run against.  The rails root contains:
** the models, controllers, and views defined under app/
** the test.rb environment file
** a migration file for each model
** a shoulda initializer that simulates loading the plugin but without relying on vendor/plugins
* fixtures - contain the sample DB data for each model
* functional - controller tests for each of the controllers under rails_root/app
* unit - model tests for each of the models under rails_root/app
* other - tests for the shoulda contexts, should statements, and assertions
* test_helper.rb - responsible for initializing the test environment
** sets the rails_env to test
** sets the rails_root
** runs all the migrations against the in-memory sqlite3 db
** adds some magic to load the right fixture files

In order to add a new model (or controller) to the test suite:

* add that model to rails_root/app/models
* add a migration for that model
* add a fixture file
* add a test for that file under test/units

Dependencies:

* Rails gem installed in the host system
* A working sqlite3 installation.

If you have problems running these tests, please notify the mailing list:  shoulda@googlegroups.com

- Tammer Saleh <tsaleh@thoughtbot.com>