Permalink
Browse files

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
  • Loading branch information...
1 parent f457ef4 commit a52132af587efa9bc9cefe3394499a681418c37e @dhh dhh committed Nov 2, 2005
View
@@ -1,5 +1,7 @@
*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>]
* Catch CGI multipart parse errors. Wrap dispatcher internals in a failsafe response handler. [Jeremy Kemper]
@@ -1,5 +1,5 @@
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
-first_<%= singular_name %>:
+first:
id: 1
-another_<%= singular_name %>:
+another:
id: 2
@@ -3,12 +3,8 @@
class <%= class_name %>Test < Test::Unit::TestCase
fixtures :<%= table_name %>
- def setup
- @<%= singular_name %> = <%= class_name %>.find(1)
- end
-
# Replace this with your real tests.
def test_truth
- assert_kind_of <%= class_name %>, @<%= singular_name %>
+ assert_kind_of <%= class_name %>, <%= table_name %>(:first)
end
end

0 comments on commit a52132a

Please sign in to comment.