From 74c8ff53e7fff1e7c1ceaf5f5205668dfa81557d Mon Sep 17 00:00:00 2001 From: Andreas Scherer Date: Mon, 16 Feb 2009 11:47:23 +0100 Subject: More tables headers formatted. --- railties/guides/source/testing.textile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'railties/guides/source/testing.textile') diff --git a/railties/guides/source/testing.textile b/railties/guides/source/testing.textile index 8129dc34c2..9cf41b7aab 100644 --- a/railties/guides/source/testing.textile +++ b/railties/guides/source/testing.textile @@ -217,7 +217,7 @@ NOTE: +db:test:prepare+ will fail with an error if db/schema.rb doesn't exists. h5. Rake Tasks for Preparing your Application for Testing -|_.Tasks |_.Description| +|_.Tasks |_.Description| |+rake db:test:clone+ |Recreate the test database from the current environment's database schema| |+rake db:test:clone_structure+ |Recreate the test databases from the development structure| |+rake db:test:load+ |Recreate the test database from the current +schema.rb+| @@ -384,7 +384,7 @@ By now you've caught a glimpse of some of the assertions that are available. Ass There are a bunch of different types of assertions you can use. Here's the complete list of assertions that ship with +test/unit+, the testing library used by Rails. The +[msg]+ parameter is an optional string message you can specify to make your test failure messages clearer. It's not required. -|_.Assertion |_.Purpose| +|_.Assertion |_.Purpose| |+assert( boolean, [msg] )+ |Ensures that the object/expression is true.| |+assert_equal( obj1, obj2, [msg] )+ |Ensures that +obj1 == obj2+ is true.| |+assert_not_equal( obj1, obj2, [msg] )+ |Ensures that +obj1 == obj2+ is false.| @@ -413,7 +413,7 @@ h4. Rails Specific Assertions Rails adds some custom assertions of its own to the +test/unit+ framework: -|_.Assertion |_.Purpose| +|_.Assertion |_.Purpose| |+assert_valid(record)+ |Ensures that the passed record is valid by Active Record standards and returns any error messages if it is not.| |+assert_difference(expressions, difference = 1, message = nil) {...}+ |Test numeric difference between the return value of an expression as a result of what is evaluated in the yielded block.| |+assert_no_difference(expressions, message = nil, &block)+ |Asserts that the numeric result of evaluating an expression is not changed before and after invoking the passed in block.| @@ -588,7 +588,7 @@ h5. Additional View-based Assertions There are more assertions that are primarily used in testing views: -|_.Assertion |_.Purpose| +|_.Assertion |_.Purpose| |+assert_select_email+ |Allows you to make assertions on the body of an e-mail. | |+assert_select_rjs+ |Allows you to make assertions on RJS response. +assert_select_rjs+ has variants which allow you to narrow down on the updated element or even a particular operation on an element.| |+assert_select_encoded+ |Allows you to make assertions on encoded HTML. It does this by un-encoding the contents of each element and then calling the block with all the un-encoded elements.| @@ -635,7 +635,7 @@ h4. Helpers Available for Integration tests In addition to the standard testing helpers, there are some additional helpers available to integration tests: -|_.Helper |_.Purpose| +|_.Helper |_.Purpose| |+https?+ |Returns +true+ if the session is mimicking a secure HTTPS request.| |+https!+ |Allows you to mimic a secure HTTPS request.| |+host!+ |Allows you to set the host name to use in the next request.| @@ -732,7 +732,7 @@ h3. Rake Tasks for Running your Tests You don't need to set up and run your tests by hand on a test-by-test basis. Rails comes with a number of rake tasks to help in testing. The table below lists all rake tasks that come along in the default Rakefile when you initiate a Rail project. -|_.Tasks |_.Description| +|_.Tasks |_.Description| |+rake test+ |Runs all unit, functional and integration tests. You can also simply run +rake+ as the _test_ target is the default.| |+rake test:units+ |Runs all the unit tests from +test/unit+| |+rake test:functionals+ |Runs all the functional tests from +test/functional+| -- cgit v1.2.3