1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Added demonstration of fixture use to the test case generated by the model generator [DHH]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2846 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
David Heinemeier Hansson 2005-11-02 10:15:31 +00:00
parent f457ef46cf
commit a52132af58
3 changed files with 5 additions and 7 deletions

View file

@ -1,5 +1,7 @@
*SVN* *SVN*
* Added demonstration of fixture use to the test case generated by the model generator [DHH]
* If specified, pass PostgreSQL client character encoding to createdb. #2703 [Kazuhiko <kazuhiko@fdiary.net>] * If specified, pass PostgreSQL client character encoding to createdb. #2703 [Kazuhiko <kazuhiko@fdiary.net>]
* Catch CGI multipart parse errors. Wrap dispatcher internals in a failsafe response handler. [Jeremy Kemper] * Catch CGI multipart parse errors. Wrap dispatcher internals in a failsafe response handler. [Jeremy Kemper]

View file

@ -1,5 +1,5 @@
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
first_<%= singular_name %>: first:
id: 1 id: 1
another_<%= singular_name %>: another:
id: 2 id: 2

View file

@ -3,12 +3,8 @@ require File.dirname(__FILE__) + '/../test_helper'
class <%= class_name %>Test < Test::Unit::TestCase class <%= class_name %>Test < Test::Unit::TestCase
fixtures :<%= table_name %> fixtures :<%= table_name %>
def setup
@<%= singular_name %> = <%= class_name %>.find(1)
end
# Replace this with your real tests. # Replace this with your real tests.
def test_truth def test_truth
assert_kind_of <%= class_name %>, @<%= singular_name %> assert_kind_of <%= class_name %>, <%= table_name %>(:first)
end end
end end