From e033b5d037c303a34e0c5aec2b38ec6270f00f86 Mon Sep 17 00:00:00 2001 From: Pratik Naik Date: Sat, 25 Jul 2009 16:03:58 +0100 Subject: Merge docrails --- railties/guides/source/testing.textile | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'railties/guides/source/testing.textile') diff --git a/railties/guides/source/testing.textile b/railties/guides/source/testing.textile index 12fc836edf..8318146ed3 100644 --- a/railties/guides/source/testing.textile +++ b/railties/guides/source/testing.textile @@ -211,7 +211,7 @@ $ rake db:migrate $ rake db:test:load -Above +rake db:migrate+ runs any pending migrations on the _developemnt_ environment and updates +db/schema.rb+. +rake db:test:load+ recreates the test database from the current db/schema.rb. On subsequent attempts it is a good to first run +db:test:prepare+ as it first checks for pending migrations and warns you appropriately. +Above +rake db:migrate+ runs any pending migrations on the _development_ environment and updates +db/schema.rb+. +rake db:test:load+ recreates the test database from the current db/schema.rb. On subsequent attempts it is a good to first run +db:test:prepare+ as it first checks for pending migrations and warns you appropriately. NOTE: +db:test:prepare+ will fail with an error if db/schema.rb doesn't exists. @@ -372,7 +372,7 @@ NameError: undefined local variable or method `some_undefined_variable' for # def test_should_route_to_post @@ -860,7 +862,7 @@ The goals of testing your +ActionMailer+ classes are to ensure that: h5. From All Sides -There are two aspects of testing your mailer, the unit tests and the functional tests. In the unit tests, you run the mailer in isolation with tightly controlled inputs and compare the output to a knownvalue (a fixture -- yay! more fixtures!). In the functional tests you don't so much test the minute details produced by the mailer Instead we test that our controllers and models are using the mailer in the right way. You test to prove that the right email was sent at the right time. +There are two aspects of testing your mailer, the unit tests and the functional tests. In the unit tests, you run the mailer in isolation with tightly controlled inputs and compare the output to a known value (a fixture -- yay! more fixtures!). In the functional tests you don't so much test the minute details produced by the mailer Instead we test that our controllers and models are using the mailer in the right way. You test to prove that the right email was sent at the right time. h4. Unit Testing -- cgit v1.2.3